How to copy values from SimulationOutput object to current workspace?

1 回表示 (過去 30 日間)
Hi.
When I call a simulink simulation with:
simout = sim('UTI_Sim','SrcWorkspace','current');
The values of my "To Workspace" blocks are stored in an Simulink.SimulationOutput object.
How do I copy the values contained in this object to the current workspace? To access them directly, without having to use get methods or dot technics.
Thankful!

採用された回答

João Ricardo  Braga de Paiva
João Ricardo Braga de Paiva 2020 年 1 月 30 日
編集済み: João Ricardo Braga de Paiva 2020 年 1 月 31 日
I find the solution! I leave it here registered for everyone who has the same problem.
options = simset('SrcWorkspace','current','DstWorkspace','current');
sim('UTI_Sim', [0 time], options);
The first statement set the options to the simulation, using the current workspace as source and destination.
The second, calls the simulation using the simulation sets over all simulation time.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeNaming Conventions についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by