Borrar filtros
Borrar filtros

How do I loop this data?

1 visualización (últimos 30 días)
Jack
Jack el 26 de Feb. de 2015
Respondida: Joseph Cheng el 26 de Feb. de 2015
% 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; >>

Respuestas (1)

Joseph Cheng
Joseph Cheng el 26 de Feb. de 2015
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?

Categorías

Más información sobre Loops and Conditional Statements en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by