How can I read any initialization data from mat file in standalone simulink aplication?
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Respuesta aceptada
Ketan
el 7 de Oct. de 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 comentarios
Ketan
el 26 de Oct. de 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.
Más respuestas (0)
Ver también
Categorías
Más información sobre Simulink Coder 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!