필터 지우기
필터 지우기

Manage multiple data sources in Simulink

조회 수: 3 (최근 30일)
Goncalo Torres
Goncalo Torres 2021년 9월 9일
답변: Pramil 2024년 2월 29일
I have a question regarding data management for Simulink models.
Let's say I have a vehicle model, where different parameters can be defined. I can store those parameters in a data dictionary or in model workspaces. However, if I need to simulate different vehicles, I will have to continuosly change the data source so that the correct parameters are used. What is the best way to do this management? Using multiple data dictionaries and then change the reference in the model explorer? Or is there a better solution?

답변 (1개)

Pramil
Pramil 2024년 2월 29일
In scenarios where multiple Simulink models are involved, what I like to do is summarised in the following points:
  1. I save the relevant parameters of a model in a MAT file using the “save” function.
  2. Under the “callbacks” section present in the “Model Properties” in “Modelling” tab in the “InitFcn, I load the same MAT file using “load” function.
Here, if two models have parameters with same name, since the “initFcn” is called each time before the model is updated, the parameter for the current model will be loaded. Hence avoiding any error with values.
Tip: If you change the parameters value, in “ClosedFcn”, you can save the MAT file again to update your parameters.
Here is a documentation page, you can refer this for getting more information about Model callbacks:

카테고리

Help CenterFile Exchange에서 Manage Design Data에 대해 자세히 알아보기

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by