Not enough input arguments.

1 vue (au cours des 30 derniers jours)
Alexander Cordero
Alexander Cordero le 16 Déc 2019
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 commentaires
Alexander Cordero
Alexander Cordero le 16 Déc 2019
Modifié(e) : Alexander Cordero le 16 Déc 2019
I am new in matlab just wondering how to fix this problem . Thank you
Alexander Cordero
Alexander Cordero le 16 Déc 2019
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);

Connectez-vous pour commenter.

Réponse acceptée

dpb
dpb le 16 Déc 2019
Modifié(e) : dpb le 16 Déc 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.
  1 commentaire
Alexander Cordero
Alexander Cordero le 16 Déc 2019
Thank you sir. Amazing explanation .

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Get Started with MATLAB dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by