function Mb = Mbcalc(i, q, AF, p, m) %Mbcalc(i, q, p, AF, m) Calculates Mb, an intermediate in the calculation of % the Modulation transfer function. Modeling based on Ijspeert, 1992. % However, this function can be used independently of the MTFip function. % %SEE: MTFip switch nargin case{1} error 'too few arguments' case{2} age = 0; p = 4; m = pigment; case{3} p = 4; m = pigment; case{4} m = pigment; case{5} case{nargin>=6} error 'too many arguments' end switch i case{1} Mb = exp(-360 * B1calc(p, AF) * q); case{2} Mb = exp(-360 * B2calc(p, AF) * q); case{3} Mb = exp(-360 * B3calc(AF, m) * q); case{4} Mb = exp(-360 * q); % B4 = 1 by definition end