How does Simulink recognize variables from an m-file?
조회 수: 9 (최근 30일)
이전 댓글 표시
I am trying to run a .slx file named train.slx from the Simulink window, and have it use variables defined in a .m file (named system.m). Should both the .m file and the .slx have the same prefix (i.e., "train") in order for the train.slx Simulink file to recognize that it should be using the variables from the specific m-file that I want it to read?
Thanks in advance! :) I'm very confused about this. I know it's probably a very simple operation but I am still learning Simulink and am unsure how this works.
댓글 수: 0
답변 (1개)
Azzi Abdelmalek
2014년 4월 27일
편집: Azzi Abdelmalek
2014년 4월 27일
Don't use the same name, also avoid the name system. Before running your simulink model, you have to run your m-file
If you want to run automatically your m-file when run your simulink model, you can add to the initfcn of your model callback the names of your m-files
참고 항목
카테고리
Help Center 및 File Exchange에서 Naming Conventions에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!