Export Model to Simulation App - Parameters Selection

4 次查看(过去 30 天)
Dear Sir or Madam,
I am developing a Simulink model I want to export as a Simulation App in order to further create a Standalone App. I observe that the exportation menu does not provide the option to define which model parameters are exportable (for instance, FMU exportation does provide this option).
I do not want all the model parameters to be exported, just a few ones; and I would like to be able to choose them.
Is there any option to solve this issue?
Best regards,
Víctor Sánchez Suárez

采纳的回答

Yash
Yash 2024-1-10
Hi Victor,
I understand that you want to export a Simulink model as a Simulation App with only select parameters. As per my knowledge there is no way currently to achieve this. However, the following workaround is possible:
1) Create a Simulink model.
2) Export the model as a Simulation App.
3) Navigate to the created directory "/assets/data". The model data is stored in this directory in "modelData.mat".
4) The tunable parameters are stored as a struct named "modelData.tunableVariables" in "modelData.mat" with fields "QualifiedName", "Value" and "Workspace".
5) Delete the undesired parameters. For example, the commands to delete a parameter named "paramName" is:
load('modelData.mat'); % ensure that "/assets/data" is added to MATLAB path before loading
modelData.tunableVariables(indexOfParamName) = []; % indexOfParamName is the index of paramName in the tunableVariables struct
6) Save changes to "modelData.mat" using the command:
save('modelData.mat','-append');
I hope this helps!

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Simulink Environment Customization 的更多信息

产品


版本

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by