Filter löschen
Filter löschen

How to declare global variables for simulink containing matlab functions?

1 Ansicht (letzte 30 Tage)
HJ Jay
HJ Jay am 25 Mai 2015
Kommentiert: Nathan Huntoon am 10 Aug. 2015
I'm building a simulink model with multiple matlab function blocks( http://in.mathworks.com/help/simulink/slref/matlabfunction.html ). Each of these function blocks have a lot of constants, for example (g=9.8), common between them. I want to initialize all of these constants in one go so that I don't have to do so in each function block.
I tried initialising all the variables in matlab workspace, but they don't seem to be working.
What is the best and easiest way to go forward with this?

Antworten (1)

Azzi Abdelmalek
Azzi Abdelmalek am 25 Mai 2015
  2 Kommentare
HJ Jay
HJ Jay am 27 Mai 2015
Not exactly what I want. I want all my parameters to be initialized by using a .m file. How can I get all of these data from the matlab workspace to the matlab function block workspaces in simulink?
Nathan Huntoon
Nathan Huntoon am 10 Aug. 2015
Did you ever figure this out? I'm also trying to get global data into multiple matlab function blocks inside a model. In my case, I want to have each of the function blocks update the same figure, and I'm trying to pass the figure handle.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Simulink Functions finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by