How to save strings in a loop into an array?
14 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Gunay Gazaloglu
am 3 Apr. 2021
Kommentiert: Gunay Gazaloglu
am 3 Apr. 2021
In this case there are 200 wind directions such NNW,NE,WNW....However,I couldnt save them into a single string array.How can I list them as XXX,XXX...
0 Kommentare
Akzeptierte Antwort
Abdolkarim Mohammadi
am 3 Apr. 2021
You should first initialize the direction vector:
direction = strings (1, 200);
Then assign a value to a certain element of direction in each loop iteration:
direction (i) = "NE";
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!