presence of data in Simulink model workspace

I am creating two custom Simulink blocks using Matlab System block method.
My intension is to understand how model workspace works. In one block some constants are loaded from a .mat file. When I use the“Model Explorer”, the constands are indeed appear in the model workspace. However, when I try to reference any of these constants in the second block, and error is generated since they are not recognized. What is wrong with my understanding of model workspace with regard to sharing of variables across blocks?
Thank you.

답변 (1개)

Keshav
Keshav 2023년 7월 26일

0 개 추천

Hi,
Actually, the Model Workspace in MATLAB Simulink is specific to a particular model. Each Simulink model has its own Model Workspace, which is separate and independent from other models.
You can read more about model workspace in the below MathWorks documentation.

댓글 수: 1

Menachem
Menachem 2023년 7월 28일
Thank you.
Just to clarify. I am asking if the variables used in a particular block are visible within the model workspace and as such, if they are or could be made visible to other blocks in the same model workspace. If not, could you suggest an easy way to accomplish this task; i.e., having global or shared variables to all blocks.

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

카테고리

도움말 센터File Exchange에서 Programmatic Model Editing에 대해 자세히 알아보기

제품

릴리스

R2022a

질문:

2023년 7월 14일

댓글:

2023년 7월 28일

Community Treasure Hunt

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

Start Hunting!

Translated by