フィルターのクリア

Info

この質問は閉じられています。 編集または回答するには再度開いてください。

In an assignment A(I) = B, the number of elements in B and I must be the same ERROR

1 回表示 (過去 30 日間)
Hamid
Hamid 2014 年 12 月 13 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
Hi everyone,I keep get this error and I don't know what is it; I will be grateful for any suggestion.
error occurs in Ke(j)=bar3e(Ex(i,:)... Line.
for j=1:lc
f=f(:,j);
for i=1:ne
K=zeros(length(f),lc);
Ke(j)=bar3e(Ex(i,:),Ey(i,:),Ez(i,:),[E Ep(i,1)]);
K(j)=assem(Edof(i,:),K,Ke);
end
end
-----------------------------------------------------------
function [Ke]=bar3e(ex,ey,ez,ep)
E=ep(1); A=ep(2);
b=[ ex(2)-ex(1); ey(2)-ey(1); ez(2)-ez(1) ];
L=sqrt(b'*b);
Kle=E*A/L*[1 -1;-1 1];
n=b'/L; G=[ n zeros(size(n)); zeros(size(n)) n ];
Ke=G'*Kle*G;

回答 (1 件)

Matt J
Matt J 2014 年 12 月 13 日
Make sure that bar3e returns a scalar. If it doesn't it should be obvious why you can't asssign it to scalar location Ke(j).

この質問は閉じられています。

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by