How to save strings in a loop into an array?
12 ビュー (過去 30 日間)
古いコメントを表示
Gunay Gazaloglu
2021 年 4 月 3 日
コメント済み: Gunay Gazaloglu
2021 年 4 月 3 日
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/571709/image.png)
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 件のコメント
採用された回答
Abdolkarim Mohammadi
2021 年 4 月 3 日
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";
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Loops and Conditional Statements についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!