Watch this Author's files

Great function, but because of not available even oder odd-function this function was not usable for newer versions of MATLAB.

I have changed for the section:

if Ordering == 'Noll'

the following three lines (old --> new):

ind = find(odd(n)); --> ind = find(mod(n,2)); ind = find(even(n)); --> ind = find(1-mod(n,2)); ind = find(even(p)); --> ind = find(1-mod(p,2));

Now it works within Matlab 7.6.0 (2008a).

Tanks!

Very great functions! But the normalization with the 'norm' - option seems to be wrong. I've changed in:

zernfun.m

% For the normalized polynomials the line 177: y(:,j) = y(:,j)*sqrt((1+(m(j)~=0))*(n(j)+1)/pi);

% I have to replaced by: if m(j)==0 y(:,j) = y(:,j)*sqrt((n(j)+1)); else y(:,j) = y(:,j)*sqrt(2*(n(j)+1)); end

Contact us