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 个评论

Hi, Please find attached the simulink file. I have commented inside the file.

请先登录,再进行评论。

 采纳的回答

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 个评论

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

请先登录,再进行评论。

更多回答(0 个)

类别

在 帮助中心 和 File Exchange 中查找有关 Simulink Functions 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by