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 件のコメント

Alexander Cordero
Alexander Cordero 2019 年 12 月 16 日
編集済み: Alexander Cordero 2019 年 12 月 16 日
I am new in matlab just wondering how to fix this problem . Thank you
Alexander Cordero
Alexander Cordero 2019 年 12 月 16 日
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);

サインインしてコメントする。

 採用された回答

dpb
dpb 2019 年 12 月 16 日
編集済み: dpb 2019 年 12 月 16 日

1 投票

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.

1 件のコメント

Alexander Cordero
Alexander Cordero 2019 年 12 月 16 日
Thank you sir. Amazing explanation .

サインインしてコメントする。

その他の回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by