Filter löschen
Filter löschen

Simulink constant parameter read inside Matlab Function block

12 Ansichten (letzte 30 Tage)
Hi. I defined some Simulink parameters to the Model Workspace of a Simulink model. When used in a Constant block, the code compiles with no error. When used in a Matlab Function block, I get the 'undefined variable' error.
How can I use global parameters in the Matlab Function block, without having to add an input port for each parameter?
Thanks
  3 Kommentare
Azzi Abdelmalek
Azzi Abdelmalek am 12 Okt. 2012
how many parameters do you have? their size?
River Rock
River Rock am 12 Okt. 2012
Bearbeitet: River Rock am 12 Okt. 2012
Matlab R2012a 6 parameters, all scalar (i left data type auto)

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Kaustubha Govind
Kaustubha Govind am 12 Okt. 2012
My answer to this previous question should work for you.

Weitere Antworten (1)

Azzi Abdelmalek
Azzi Abdelmalek am 12 Okt. 2012
Bearbeitet: Azzi Abdelmalek am 12 Okt. 2012
If you have sevral parameters with the same size , you can use one constant block with value
[param1 param2 ... paramn]

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