MATLAB Answers

using a variable in simulink function

2 views (last 30 days)
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

Rashmil Dahanayake
Rashmil Dahanayake on 23 Dec 2013
Hi, Please find attached the simulink file. I have commented inside the file.

Sign in to comment.

Accepted Answer

Kaustubha Govind
Kaustubha Govind on 30 Dec 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 Comment

Rashmil Dahanayake
Rashmil Dahanayake on 31 Dec 2013
It worked after changing the data type from input to parameter Thanks

Sign in to comment.

More Answers (0)