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 Comments

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

Sign in to comment.

 Accepted Answer

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 Comment

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

Sign in to comment.

More Answers (0)

Categories

Find more on Modeling in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!