using a variable in simulink function

I have a user defined function in simulink.
I need to use a global variable from simulink work space. How can access the simulink local worksspace, for the usage of simulink user defined function

2 Commenti

This is not clear
Hi, Please find attached the simulink file. I have commented inside the file.

Accedi per commentare.

 Risposta accettata

Kaustubha Govind
Kaustubha Govind il 30 Dic 2013
I'm assuming that by "User Defined Function", you actually mean the MATLAB Function block? If so, you can read a workspace variable, by passing it in as a block parameter.

1 Commento

It worked after changing the data type from input to parameter Thanks

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Modeling in Centro assistenza e File Exchange

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by