I want to run several Simulink simulations of the same model, with different parameters, and store all the logged data in all the simulations for further analysis in the workspace. I have read the different approaches to export simulation data. In a for sim() end approach, what should we preallocate? logsout and tout are structures, so how do I preallocate a structure of structures? Is there a better approach to achieve the same?
preallocation_logs = ???????;preallocation_times = ???????;for i=1:number_of_simulations % (update some simulation parameter here)
sim('simulink_model'); preallocation_logs(i) = logsout; preallocation_times(i) = tout;end
Best Answer