How to save strings in a loop into an array?
12 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Gunay Gazaloglu
el 3 de Abr. de 2021
Comentada: Gunay Gazaloglu
el 3 de Abr. de 2021
![](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 comentarios
Respuesta aceptada
Abdolkarim Mohammadi
el 3 de Abr. de 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";
Más respuestas (0)
Ver también
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!