Borrar filtros
Borrar filtros

How to export simulink data to workspace during simulation?

13 visualizaciones (últimos 30 días)
Po-Jen
Po-Jen el 8 de Jun. de 2013
Comentada: piyush raj el 11 de Oct. de 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 comentarios
Azzi Abdelmalek
Azzi Abdelmalek el 8 de Jun. de 2013
Whatvis the problem with to workspace block?
piyush raj
piyush raj el 11 de Oct. de 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

Iniciar sesión para comentar.

Respuesta aceptada

Azzi Abdelmalek
Azzi Abdelmalek el 8 de Jun. de 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 comentarios
Po-Jen
Po-Jen el 8 de Jun. de 2013
Editada: Po-Jen el 9 de Jun. de 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.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Simulink Functions en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by