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!