필터 지우기
필터 지우기

How do I loop this data?

조회 수: 1 (최근 30일)
Jack
Jack 2015년 2월 26일
답변: Joseph Cheng 2015년 2월 26일
% Degrees of Freedom;
% Free
Bl=1;
BR=hd+1;
TL=(hd+1)*(vd+1)-hd;
TR=(hd+1)*(vd+1);
freedof=[Bl,BR,TL,TR];
for i=Bl+1:BR-1;
freedof(i)=[3i-2 3i-1 3i];
end
for i = BR+1:1:TL-1
end
for i=TL+1:1:TR-1
end
error comes back as :
In an assignment A(I) = B, the number of elements in B and I must be the same.
Error in FDM>readinputdata (line 80) freedof(i)=[3i-2 3i-1 3i];
Error in FDM (line 9) [ndof,nnodes,connectivity,q,freedof,P,fixdof,Uf,axialunits,lengthunits]=readinputdata; >>

답변 (1개)

Joseph Cheng
Joseph Cheng 2015년 2월 26일
from what i see, without running it, is that in the freedof(i)=[3i-2 3i-1 3i]; it is trying to assign all 3 3i-2 3i-1 3i] into the index freedof(i) which is 1x1. to get around this you can go
freedof(i,:)=[3i-2 3i-1 3i];
one other thing i see is that you define freedof right before the for loop as a 1x4 matrix. however in the forloop freedof is 1x3. what are you looking for the other number?

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by