
Problem with program FEM
Posted:
Sep 15, 2013 9:32 PM


Hello, i have a problem with my program function y=diri(a,b,n) h=(ba)./(n+1); x=a:h:b; f=pi^2.*sin(pi.*x); f=@(x)pi.^2.*sin(pi.*x); for i=1:n e1=(xx(i))/(x(i+1)x(i)); e1=@(x) (xx(i))/(x(i+1)x(i)); e2=(x(i+2)x)/(x(i+2)x(i+1)); e2=@(x) (x(i+2)x)/(x(i+2)x(i+1)); F=quad(f(x).*e1(x),x(i),x(i+1))+quad(f(x).*e2(x),x(i+1),x(i+2)); end
I get the following error
??? Error using ==> fcnchk at 108 FUN must be a function, a valid string expression, or an inline function object.
Error in ==> quad at 66 f = fcnchk(funfcn);
Error in ==> diri at 16 F=quad(f(x).*e1(x),x(i),x(i+1))+quad(f(x).*e2(x),x(i+1),x(i+2));
Please help me.
Thanks.

