To workspace Block and To Workspace Signal don't exist in workspace
조회 수: 7 (최근 30일)
이전 댓글 표시
Hi,
I don't understand why i can't assign simout or yout (default name of To Worspace block's variable) as variables in m.file editor after i started simulink simulation.
댓글 수: 2
답변 (5개)
Seth Popinchalk
2011년 3월 29일
Variables assigned to the workspace do not appear until the model is paused or stopped. If you are trying to process the data from the simulation while the simulation is running, it is better to do that from a MATLAB S-function.
댓글 수: 0
Harsha Vardhan Rao Avunoori
2011년 3월 29일
Your simulation should come to a halt if you want to export data to workspace....or try using the S-function block....
댓글 수: 0
Kaustubha Govind
2011년 3월 30일
Again, as Seth pointed out, file.mat is not available until after the simulation is paused/stopped. Instead, feed the signal that you are logging as input to the S-function.
function Outputs(block)
a = block.InputPort(1).Data;
% your code here
댓글 수: 5
Kaustubha Govind
2011년 3월 31일
I don't think I understand your question - why are you using a From File block?
cyberdyne
2011년 3월 31일
댓글 수: 5
Kaustubha Govind
2011년 4월 4일
Maybe there is no index "J" in the variable a.ans3? I would recommend setting a breakpoint at this line and debug to see if you are indexing into the variable correctly.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!