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
0 个评论
采纳的回答
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 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Simulink Environment Customization 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!