How can I read any initialization data from mat file in standalone simulink aplication?
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi,
I have a model with some parameters (gain, amplitude, simulation stop time ...), which are initialized by InitFcn callback. In this callback I read parameters from mat file. Simulink simulation is OK. But after code generation to exe file (with rsim.tlc target file) parameters are not initialized with my mat file. How can I solve my problem? Thanks,
Mirec
0 Kommentare
Akzeptierte Antwort
Ketan
am 7 Okt. 2012
The simulation stop time can be selected by using the '-tf' flag when calling the rsim exe. For example :
>>!myRSimModel.exe -tf 100.0
You should be able to set parameter values of the model using a MAT file with the '-p' flag. Check out the sections "Create a MAT-File That Includes a Model Parameter Structure" and "Change Block Parameters for an RSim Simulation" in the following doc page :
4 Kommentare
Ketan
am 26 Okt. 2012
Hi Miraslov,
I don't think you can do this if your parameter values are stored within a MATLAB struct. You may want to change the architecture of the model from a structure containing values for all parameters to individual workspace variables for each parameter. After doing this you should be able to determine the mapping between values in the vector and parameters. You will need first enable Inline Parameters and configure the parameters that should be tunable. After doing this calling RSIMGETRTP with 'AddTunableParamInfo' set to 'on' will create additional fields within the parameter structure that define the mapping between parameters and entries. Please see the doc page for RSIMGETRTP for more info on this.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Simulink Coder finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!