function prod=prod(x) %----------------------------------------------------------------------- % For i>0, return the product of a set of given basis functions. % For i=0, return the function values. % Input x is a row vector %----------------------------------------------------------------------- global i j f = [ besselj(0,x); besselj(0,2*x); besselj(0,3*x); besselj(0,4*x); besselj(0,5*x) ]; if i>0 prod = f(i,:).*f(j,:); % prod = besselj(0,lambda(i)*x) .* besselj(0,lambda(j)*x); else prod=f; end