what is the problem of this code?

please discribe the problem for me f=sym('f',[1 4]) q=zeros(1,4) for i=0:3 f(1,i+1) = (@(x)(exp(-x).*(x.^0.5).*x.*laguerreL(i,0.5,x))) %g(1,i+1)=quadgk(f(1,i+1),0,1) end in this code i want to calculate double int that funtion is a array of M+1 dimention

1

There are 1 best solutions below

3
John Bofarull Guix On
figure
hold on

q=zeros(1,4);
for k=1:4 
    
    f1=@(x) (exp(-x).*(x.^0.5).*x.*laguerreL(k,x)); 
    fplot(f1);
    g(k)=quadgk(f1,0,1) 
end

grid on
legend('1','2','3','4')

enter image description here

The resulting integrals

g'
ans =
   0.067073046736390
  -0.016768261684098
  -0.064107950475923
  -0.085353721623712

There are no LaguerreL polynomials of order 0.

In MATLAB the 1st element is always indexed 1, not 0.