Assign fields to structure array in Simulink
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
VuKhoa
el 2 de Mzo. de 2020
Comentada: stozaki
el 6 de Mzo. de 2020
I have an Array of 5 structures, say A(1), A(2)...A(5). Each of them have 3 fields which are: A(i).field1, A(i).field2, A(i).field3.
I would like to assign a constant value to each field in all structure using Simulink blocks. I am using for loop to circle amongst A(i). How can I access field1, field2, field3 in each structure?
0 comentarios
Respuesta aceptada
stozaki
el 3 de Mzo. de 2020
2 comentarios
stozaki
el 6 de Mzo. de 2020
@VuKhoa,
You need a .mat file.
If you can use the bus signal, you can use a method like the attachment.
The method is to assign structure variables to bus signals.
run myData
run myBus
open_system('BusModel');
sim('BusModel');
Regards,
stozaki
Más respuestas (0)
Ver también
Categorías
Más información sobre Programmatic Model Editing en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!