How to save or convert a simulink model to csv file
Mostrar comentarios más antiguos
Hi all,I have a tank system in simulink and would like to save or convert it to a csv file.Does anyone know how this can be done?
Respuesta aceptada
Más respuestas (3)
Joseph
el 23 de Mzo. de 2012
0 votos
K E
el 23 de Mzo. de 2012
0 votos
Are you trying to pass the output of a Simulink model into LabView, such as a time series of simulated position and velocity? If so then you can use a To Workspace block in your Simulink model to pass the time series out of Simulink and into Matlab's workspace, then in Matlab you could save the variable to a CSV file using a Matlab utility such as csvwrite. Then you could read the resulting csv file into LabView. There are other ways to go from [Simulink time series] to [saved csv file]; this is one example.
3 comentarios
K E
el 26 de Mzo. de 2012
Alternatively you can save the Simulink output to a *.mat file using the 'To File' block (http://www.mathworks.com/help/toolbox/simulink/slref/tofile.html). Perhaps there is a LabView utility to read a mat file into LabView. Or, you could add a function block to your Matlab model that uses fprintf or csvwrite to export the data, but see Fangjun's warning about it here,
http://www.mathworks.com/matlabcentral/answers/15982-how-to-store-output-data-from-a-simulink-model-to-a-text-file
Joseph
el 26 de Mzo. de 2012
K E
el 26 de Mzo. de 2012
Here is a thread on reading a mat file into Labview,
http://forums.ni.com/t5/LabVIEW/I-want-to-read-a-Matlab-MAT-file-into-labview/td-p/322423
Since I am not a Labview user, you would want to follow up in that forum with any followup Labview questions.
Joseph
el 26 de Mzo. de 2012
0 votos
1 comentario
Kaustubha Govind
el 26 de Mzo. de 2012
This might be of help: Building a LabVIEW User Interface for a Simulink® Model with LabVIEW Simulation Interface Toolkit (http://zone.ni.com/devzone/cda/tut/p/id/3057).
Categorías
Más información sobre Programmatic Model Editing en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!