Store the structure fields generated in a for loop into a vector
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Karthik Brs
el 27 de Oct. de 2015
Hello everyone, I have a small problem here, my 1*2 struct of the name 'ord' has 7 fields as can be seen in the figure.
This structure is generated in a 'for' loop. So, depending on the looping condition it can also be a 1*3... 1*n struct. I am required to create a vector which contains the field data of 'rpm' which gets generated each time the 'for' loop runs. In other words, I simply want to store ord(1).rpm, ord(2).rpm and so on.. into vectors. In this case it is just a 1*2 struct, I am looking for a code which can store the data generated in the rpm field as and when it gets generated while in loop!
Thank you in advance!
0 comentarios
Respuesta aceptada
Thorsten
el 27 de Oct. de 2015
Editada: Thorsten
el 27 de Oct. de 2015
Use a cell array:
RPM{i} = ord.rpm;
Más respuestas (0)
Ver también
Categorías
Más información sobre Structures 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!