How can i send data to M-File with Simulink?

I ask similar question before that. It was " How do i send file to Simulink with M-file?" I could do that with Constant block and set_param(mdl/Constant,'Value', 'Pts') in M-File, it is working perfectly. In Simulink; i have a variable in changing with real-time, i saved the data in Goto block. But; "Goto" block hasn't "value" parameter and couldn't sending the data to M-File with get_param command. How can i send the data?
Note: It is important that variable is changing with real-time. Therefore "simout" isn't working in real-time cause of being in structure or array type.

 採用された回答

TAB
TAB 2012 年 1 月 9 日

1 投票

Goto and from blocks are just used for signal routing(Connection)
Values to ToWorkspace will be available only after simulation is finished.
To access the simulink data at runtime a special simulink object is there. You have to create a m-file s-function to use that oject.
Please see

2 件のコメント

Erçin
Erçin 2012 年 1 月 9 日
Same day i opened this subject, i found runtimeobject document too. It would see my job. I think Matlab level-2 S-Function is too complicated. Thank you by the way...
Luxmi Hadala
Luxmi Hadala 2016 年 11 月 7 日
How did you get the runtimeobject document? I need run time data from simulink. How can i do that?

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeProgrammatic Model Editing についてさらに検索

質問済み:

2012 年 1 月 6 日

コメント済み:

2016 年 11 月 7 日

Community Treasure Hunt

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

Start Hunting!

Translated by