Functions | |
if (nargin< 2||nargin > 3) print_usage() | |
endif | if (nargin==3) normalization |
if (!warned_overflow) if(any(abs(lpm3a) > realmax)||any(abs(lpm3b) > realmax)||any(abs(lpm3) > realmax)) overflow | |
endif endif endfor | retval (m,:) |
if (strcmp(normalization,"unnorm")) scale | |
endfor | retval (n+1,:) |
if (strcmp(normalization,"sch")) retval(1 | |
Variables | |
function | retval |
else | normalization = "unnorm" |
endif if(!isscalar(n)||n < 0||n!=fix(n)) error("legendre endswitch | scale = scale * ones (1, numel (x)) |
overflow = false | |
for | m |
lpm2 = (2*m-1) .* x .* scale | |
lpm3 = lpm2 | |
for | k |
lpm3b = (k+m-2) .* lpm1 | |
lpm1 = lpm2 | |
__pad14__ | |
__pad15__ |
if | ( | strcmp(normalization,"sch") | ) |
if | ( | strcmp(normalization,"unnorm") | ) |
if | ( | ! | warned_overflow | ) |
endfor retval | ( | n+ | 1, | |
: | ||||
) |
lpm2 = (2*m-1) .* x .* scale |
else normalization = "unnorm" |
overflow = false |
function retval |
Initial value:
legendre (n, x, normalization) persistent warned_overflow = false
endif scale = scale * ones (1, numel (x)) |