Having problem getting data from simulink model with just matlab script?

14 ビュー (過去 30 日間)
Kushal Madane
Kushal Madane 2015 年 5 月 25 日
回答済み: Dmitriy Kornol 2021 年 12 月 1 日
I was interested in automating a procedure in which i would be able to fetch data from simulink model. I have tried signal logging and simout techniques. But problem is that for both of them i have to manually run the model. If i do it from matlab script, model runs and i can see output varying on scope but data doesnt comes to workscape. The script that i have made runs in loop for few thousand times and i am not interested in manually running the model after every loop. I will be very glad if someone helps me out!!!

回答 (1 件)

Dmitriy Kornol
Dmitriy Kornol 2021 年 12 月 1 日
In the Simulink environment, there are blocks "From Workspace" and "To Workspace". The "To Workspace" block exports data in the Simulink model to the workspace after each simulation. But at the same time, you need to configure the parameters of the Simulink model solver. It is better to set a fixed step, approximately 0.001. Otherwise, the data will fly to the workspace with variable discreteness.

カテゴリ

Help Center および File ExchangePrepare Model Inputs and Outputs についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by