set base workspace variable from callback
조회 수: 2 (최근 30일)
이전 댓글 표시
Good morning, I am trying to set one variable of the base workspace from a pushbutton callback. I tried with assign but it isn`t possible because when I am in the callback the variable doesn`t exist. When I get out of the callback I see the variable in the workspace but it hasn`t changed.
Thanks in advance!
댓글 수: 0
답변 (1개)
Image Analyst
2015년 5월 29일
You need to use "assignin()" - is that what you used? If you did, then what was your code? Why do you want to do that anyway, instead of using normal ways of passing variables?
댓글 수: 2
Image Analyst
2015년 5월 29일
I don't know Simulink but in MATLAB, that's not how you're supposed to do it. You're supposed to pass variables in and out via the input and output argument lists. Can you do that in Simulink?
참고 항목
카테고리
Help Center 및 File Exchange에서 Model, Block, and Port Callbacks에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!