Filter löschen
Filter löschen

Export Model to Simulation App - Parameters Selection

6 Ansichten (letzte 30 Tage)
Victor
Victor am 3 Jan. 2024
Beantwortet: Yash am 10 Jan. 2024
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

Akzeptierte Antwort

Yash
Yash am 10 Jan. 2024
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!

Weitere Antworten (0)

Kategorien

Mehr zu Simulink Environment Customization finden Sie in Help Center und File Exchange

Produkte


Version

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by