Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Problem with program FEM
Replies: 8   Last Post: Sep 16, 2013 12:52 PM

 Messages: [ Previous | Next ]
 Ricardo Tamarín Posts: 6 Registered: 9/15/13
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=(b-a)./(n+1);
x=a:h:b;
f=pi^2.*sin(pi.*x);
f=@(x)pi.^2.*sin(pi.*x);
for i=1:n
e1=(x-x(i))/(x(i+1)-x(i));
e1=@(x) (x-x(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));
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

Thanks.

Date Subject Author
9/15/13 Ricardo Tamarín
9/15/13 Nasser Abbasi
9/15/13 Ricardo Tamarín
9/15/13 Nasser Abbasi
9/15/13 Ricardo Tamarín
9/15/13 Nasser Abbasi
9/16/13 Ricardo Tamarín
9/16/13 Steven Lord
9/16/13 Ricardo Tamarín