Effacer les filtres
Effacer les filtres

How to export simulink data to workspace during simulation?

12 vues (au cours des 30 derniers jours)
Po-Jen
Po-Jen le 8 Juin 2013
Commenté : piyush raj le 11 Oct 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 commentaires
Azzi Abdelmalek
Azzi Abdelmalek le 8 Juin 2013
Whatvis the problem with to workspace block?
piyush raj
piyush raj le 11 Oct 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

Connectez-vous pour commenter.

Réponse acceptée

Azzi Abdelmalek
Azzi Abdelmalek le 8 Juin 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 commentaires
Po-Jen
Po-Jen le 8 Juin 2013
Modifié(e) : Po-Jen le 9 Juin 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.
Kaustubha Govind
Kaustubha Govind le 10 Juin 2013

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Simulink Functions dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by