Simulink : How can I update the data from Workspace while the simulation is running?

1 回表示 (過去 30 日間)
Baptiste
Baptiste 2015 年 3 月 20 日
コメント済み: Baptiste 2015 年 3 月 20 日
Hello, My simulation is writing data in Matlab from Simulink, then I do so computations on Matlab and then I want to read the results on Simulink. The problem is that the box "From Workspace" doesn't update the values during the simulation running. Is there a solution for updating the values or no? Thanks for the help.

回答 (1 件)

Sebastian Castro
Sebastian Castro 2015 年 3 月 20 日
Simulink only writes data to the workspace when a simulation is completed or stopped.
You could use a MATLAB Function block to do the MATLAB computation inside the Simulink model?
- Sebastian
  1 件のコメント
Baptiste
Baptiste 2015 年 3 月 20 日
Simulink writes during pause also. This is what I did. I paused the simulation, so the data can be written, and then continue it. But I would like to read values from the workspace (values that are updated during the simulation). And I cannot use Matlab Function, because I run the Simulink with TwinCat, so a lot of function are not available (like corr, pca, run, ...).

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

カテゴリ

Help Center および File ExchangeEvent Functions についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by