Filter löschen
Filter löschen

How to export simulink data to workspace during simulation?

12 Ansichten (letzte 30 Tage)
Po-Jen
Po-Jen am 8 Jun. 2013
Kommentiert: piyush raj am 11 Okt. 2016
Hi, I want to retrieve the data from simulink during simulation, and use serial function to send these data to other applications.
I've tried using To Workspace block to export the data.
However, I can only got value in the very beginning of the simulation.
I've found this page http://www.mathworks.com/help/simulink/ug/exporting-simulation-data.html, but I still don't know how to continuously export data during simulation.
EDIT: Use scope and change some properties: check Save Data To Workspace and Uncheck Limite data to Last seems to be getting the data from simulink when the simulation stop.
First, I started simulation, and I found the ScopeData didn't appear in the Workspace. Only when I stop simulation, ScopeData would appear in workspace.
And after that, I can use ScopeData.signals.values to get values.
But what I want is: when I start simulation, ScopeData would appear in workspace so that I can send these data to other program.
Does anyone know how to achieve this?
  2 Kommentare
Azzi Abdelmalek
Azzi Abdelmalek am 8 Jun. 2013
Whatvis the problem with to workspace block?
piyush raj
piyush raj am 11 Okt. 2016
Check out this link. Might be helpful. If anybody can suggest anything else please do.
https://www.google.co.in/url?sa=t&rct=j&q=&esrc=s&source=web&cd=3&cad=rja&uact=8&ved=0ahUKEwit5ebbwdPPAhVGqI8KHXz_BcgQFggjMAI&url=http%3A%2F%2Fwww.mathworks.in%2Fhelp%2Fsimulink%2Fug%2Faccessing-block-data-during-simulation.html&usg=AFQjCNG_lCxik62CAKPW9q-nhKPkq4ornA&sig2=9VTeF8PFlGBOVP8gIDXNMQ

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Azzi Abdelmalek
Azzi Abdelmalek am 8 Jun. 2013
There are several ways to export your data to workspace
  1. you can use a scope where you will change some properties: check Save Data To Workspace and Uncheck Limite data to Last
  2. Use a to Workspace Block
  3. Use a to File block, which you can load after simulation
  2 Kommentare
Po-Jen
Po-Jen am 8 Jun. 2013
Bearbeitet: Po-Jen am 9 Jun. 2013
I misinterpreted the results, I can only get data after stopping the simulation, but what I want is getting data during runtime and send these data to another program so that the program can get the correct data it needs.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Simulink Functions finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by