How to use for loop in this problem
Mostrar comentarios más antiguos
n=3;
b=eye(n);
b1=b(:,1)
b2=b(:,2)
b3=b(:,3)
2 comentarios
"How to use for loop in this problem"
The main problem I can see is forcing pseudo-indices into variable names. Once beginners start trying to access those variable names dynamically then they force themselves into writing slow, complex, inefficient code trying to access their data:
Basically your bad data design will force you into writing bad code.
What do you think is the problem?
하민 김
el 26 de Abr. de 2022
Respuestas (1)
chrisw23
el 28 de Abr. de 2022
0 votos
Maybe this helps.
tbl = array2table(b);
tbl.b1
tbl.b2
tbl.b3
% see also tbl.Properties
Categorías
Más información sobre Creating, Deleting, and Querying Graphics Objects en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!