필터 지우기
필터 지우기

SIM command clears workspace

조회 수: 6 (최근 30일)
Superfish
Superfish 2012년 11월 1일
댓글: Mohammad 2017년 10월 2일
I'm trying to run a simulink simulation from an M-file. The problem is that running 'sim' clears the current workspace, and thus clears variables needed in the simulink simulation and also nested for loop variables.
I've tried
simset('SrcWorkspace','current', 'DstWorkspace', 'current');
As a 'SIM' options parameter as suggested in previous posts with similar titles, however, this does absolutely nothing.
How do I stop 'SIM' clearing my workspace? Running MATLAB R2011b.
  댓글 수: 10
Jan
Jan 2017년 10월 1일
What do you think about the suggestion to open a new thread? Then it is possible to post an answer in the section for answers and you can accept an answer, if it solves your problem.
Mohammad
Mohammad 2017년 10월 2일
I did open a new thread. But neither you nor anybody else answered me.

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

답변 (1개)

Ryan G
Ryan G 2012년 11월 2일
This SIM command should not clear your workspace, you should not have to workaround that.
Check your model callbacks and see if there is any functions/scripts being called that clear the workspace.

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by