Filter löschen
Filter löschen

How can I transfer variables From matlab code to simulink

18 Ansichten (letzte 30 Tage)
Yago Soria
Yago Soria am 23 Mär. 2017
Beantwortet: Eeshan Mitra am 28 Mär. 2017
I have a huge number of variables, some of them are data from excel, and I have all these information in matlab code (.m), how can I transfer variables to Simulink in order to work as we do with 'From-goto' blocks in Simulink?
I used 'from workspace' but it give some problems.
Thanks, I really apreciate your suport.

Antworten (1)

Eeshan Mitra
Eeshan Mitra am 28 Mär. 2017
What errors do you encounter when using the 'From workspace' block?
I assume variables are loaded from the m-file. In addition to using the 'From workspace' block, you may also use the following methods:
  1. Use MATLAB function blocks to achieve the same. You may find more information here: http://www.mathworks.com/help/simulink/slref/matlabfunction.html
  2. Conversely, you may use Model Callbacks. To look at an example of how you may load variables from a MATLAB script (m-file) when opening a model in Simulink, follow this link: http://www.mathworks.com/help/simulink/ug/create-models-and-open-existing-models.html#btozflu-1.

Kategorien

Mehr zu Modeling finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by