Simulink generate input at begining of simulations
3 views (last 30 days)
I want to simulate system behavior for input events with random characteristics.
As I want to study many parameters of the random event characteristics, it is not feasible to generate data in large quanities and store it in a matfile.
My plan is to create an event generator block, that has the event parameters as arguments.
So far my idea is to use a Start function to generate the actual event at the begining of a simulation from those parameters.
How can I get the signal generated in that start function to be the output of my event generator?
Jim Riggs on 15 Nov 2022
Edited: Jim Riggs on 15 Nov 2022
I am not sure that I understand your specific question (i.e. the implementation you are describing).
The way it sounds to me, you want to run your model for a large number of different starting conditions. To do this, I would run the Simulink model from a Matlab script. This script would have a section where the initial parameters for the model are defined, then run the Simulink model using the 'sim' command. The simulink model can refer to variables defined in the Matlab workspace.
You can build a loop structure to run your Simulink model many times, and the model can export data using the '"to workspace" block which you can then manipiulate or save for further reference.