function [xi,w] = GaussInt2Pt()
xi = [-sqrt(1/3) sqrt(1/3)];
w = [1 1];
return;
end
function [N,B,Jac] = shapeQuadratic(x1,x2,x3,xi)
%%Le = x3- x1;
N = (1/2)*[(-xi+xi^2) 2*(1-xi^2) (xi+xi^2)];
Jac = [(1/2)*(-1+2*xi) -2*xi (1/2)*(1+2*xi)]*[x1;x2;x3];
B = diff(N)/Jac;
return;
end

2 Comments

Alexander Cordero
Alexander Cordero on 16 Dec 2019
Edited: Alexander Cordero on 16 Dec 2019
I am new in matlab just wondering how to fix this problem . Thank you
this is the Error screen
Not enough input arguments.
Error in SteadyHeatForStudents1>shapeQuadratic (line 358)
N = (1/2)*[(-xi+xi^2) 2*(1-xi^2) (xi+xi^2)];
Error in SteadyHeatForStudents1>element (line 283)
[N,B,Jac] = shapeQuadratic(x1,x2,x3(intPt));
Error in SteadyHeatForStudents1 (line 141)
[Ke,Fe] = element(nInt,nNode,nodeCoords,Area,Ktherm,source);

Sign in to comment.

 Accepted Answer

dpb
dpb on 16 Dec 2019
Edited: dpb on 16 Dec 2019
Looks disjointed in the error message but in
function [N,B,Jac] = shapeQuadratic(x1,x2,x3,xi)
there are four arguments required and your call above has only three...that would give rise to the error "not enough input arguments".
Simple example that can do at command line...
>> fn=@(x,y,z,xi) sum([x,y,z,xi]); % define anonymous function needs four inputs
>> fn(1,2,3,4) % call with four arguments -- get expected
ans =
10
>> fn(1,2,3) % try with only three...boom!
Not enough input arguments.
Error in @(x,y,z,xi)sum([x,y,z,xi])
>>
The solution of the problem is simple--supply the additional needed input.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!