To workspace Block and To Workspace Signal don't exist in workspace
古いコメントを表示
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 件のコメント
Paulo Silva
2011 年 3 月 29 日
please provide more details, code, etc
cyberdyne
2011 年 3 月 30 日
回答 (5 件)
Seth Popinchalk
2011 年 3 月 29 日
0 投票
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.
Harsha Vardhan Rao Avunoori
2011 年 3 月 29 日
0 投票
Your simulation should come to a halt if you want to export data to workspace....or try using the S-function block....
cyberdyne
2011 年 3 月 30 日
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 件のコメント
cyberdyne
2011 年 3 月 30 日
Kaustubha Govind
2011 年 3 月 30 日
Yes, if those are the properties of the signal being logged.
cyberdyne
2011 年 3 月 30 日
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 日
cyberdyne
2011 年 3 月 31 日
5 件のコメント
Kaustubha Govind
2011 年 3 月 31 日
You cannot load file.mat because it does not exist at this point of the simulation. You connect your signal (which was acting as input to the To File block) directly to the input of this S-function. You do not need any To/From File blocks anymore.
cyberdyne
2011 年 3 月 31 日
Kaustubha Govind
2011 年 4 月 1 日
Could you paste the exact line that the error message is pointed to?
cyberdyne
2011 年 4 月 3 日
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.
カテゴリ
ヘルプ センター および File Exchange で General Applications についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!