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!