Azzera filtri
Azzera filtri

How to export simulink data to workspace during simulation?

12 visualizzazioni (ultimi 30 giorni)
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 Commenti
Azzi Abdelmalek
Azzi Abdelmalek il 8 Giu 2013
Whatvis the problem with to workspace block?
piyush raj
piyush raj il 11 Ott 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

Accedi per commentare.

Risposta accettata

Azzi Abdelmalek
Azzi Abdelmalek il 8 Giu 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 Commenti
Po-Jen
Po-Jen il 8 Giu 2013
Modificato: Po-Jen il 9 Giu 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.

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Simulink Functions in Help Center e File Exchange

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by