variables in Simulink Workspace
이전 댓글 표시
Hi,
I have created a variable 'simout' with the To Workspace block in Simulink. Now I have to use this in a m file, but an error indicates that 'simout' is not defined. How to import this in a m file?
Thanks Senmeis
답변 (4개)
Kaustubha Govind
2012년 10월 19일
1 개 추천
Azzi Abdelmalek
2012년 10월 19일
0 개 추천
If it's In workspace, means it's recognized by m file. check your to workspace block, then set save format to array
dimitris
2012년 10월 19일
0 개 추천
Simulink resolves variables from base workspace, so if you use simout from a function it wont be able to 'see' it because functions use their own workspace. The following link might help you.
Owen
2012년 10월 22일
댓글 수: 2
Azzi Abdelmalek
2012년 10월 22일
편집: Azzi Abdelmalek
2012년 10월 22일
Owen, Variables from to workspace block are seen by any m file, (except Functions). Check if your variable is simout and not Simout or any typo error. To be sur rename it 'x' for e.g
Kaustubha Govind
2012년 10월 23일
편집: Kaustubha Govind
2012년 10월 23일
Oops, I meant to say that you need to use:
options=simset('SrcWorkspace','current','DstWorkspace','current');
sim('mymdl',[0 duration],options)
So that 'To Workspace' writes to the function workspace.
카테고리
도움말 센터 및 File Exchange에서 Interactive Model Editing에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!