MATLAB: Assign fields to structure array in Simulink

arraysimulinkstructures

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?

Best Answer

You can use MATLAB Function as following.
I attached example model and .mat included struct data.