필터 지우기
필터 지우기

Simulink: How to pass mask input values a masked subsysem

조회 수: 8 (최근 30일)
MP
MP 2024년 1월 7일
댓글: MP 2024년 1월 7일
Context: I have a masked model that contains two instances of the same masked submodel. I would like to pass values from the top system mask down to the underlying subsystems. Is there an easy way of doing this?
I tried to go into the mask editor of the top level mask, and promote the values from the subsystems below. When i do that, there is a name clash between the variables in the subsystems since they are based on the same model.
Is there a better way of doing this?

채택된 답변

Venkat Siddarth Reddy
Venkat Siddarth Reddy 2024년 1월 7일
편집: Venkat Siddarth Reddy 2024년 1월 7일
Hi @MP,
I understand that you are trying to pass parameter values from a masked model to same masked submodels by promoting the values.However, you are facing a name clash between the variables in the subsystem, as they are based on the same model.
To solve this issue,you can try "Referencing block parameter values using variable names" approach.
With this approach, you can add an Edit parameter to the mask dialog box and pass values to the block parameters through it. The values that you provide for the Edit parameter in the mask dialog box automatically become associated with the block parameter by using the techniques described in "Symbol Resolution".
To learn more about this approach and Symbol resolution , please refer to the following documentation:
However the above approach works only if the parameters are "Edit parameters".
I hope this helps! If not, please share the model and the name clash message for further understanding.
  댓글 수: 1
MP
MP 2024년 1월 7일
Hello, thanks the reply!
I don't fully understand this example though. If the values are passed through the mask dialog and are automatically associated with the variables m and x, wouldn't there still be a name clash if the subsystems underneath are two instances of the same model?

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Subsystems에 대해 자세히 알아보기

제품


릴리스

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by