Table in a for loop
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Mads Kattrup Pedersen
am 3 Mai 2021
Kommentiert: Mads Kattrup Pedersen
am 3 Mai 2021
Hello, im having trouble figuring out how to make a table inside my for loop.
Im currently using disp and i would like to "print" it to a table instead. Preferably leftFootContact. The table would be roughly 1186 rows in 1 column.
datalength = length(tree.footContact(1).footContacts);
leftFootContact = [];
for ii=1:datalength
if tree.footContact(1).footContacts(ii,1) == 0 && tree.footContact(2).footContacts(ii,1) == 0
disp('0')
else
disp('1')
end
end
2 Kommentare
Adam Danz
am 3 Mai 2021
It's not clear what you'd like to display. '0' and '1' are single characters. How should be be displayed as tables?
Akzeptierte Antwort
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Loops and Conditional Statements finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!