make function without input.

7 次查看(过去 30 天)
진회
진회 2024-4-9
I want to make function without input.
Because, the variables which are needed as inputs for the function are so many and already in workspace.
The variables come from simulink by using 'To workspace'
So, i wonder how to use function with variables that are in workspace without function input.
  3 个评论
진회
진회 2024-4-9
编辑:진회 2024-4-9
oh sorry i missed one information.
what i am interesting is matlab script not simulink
Stephen23
Stephen23 2024-4-9
编辑:Stephen23 2024-4-9
Probably the best approach would be to store the values in one structure. That would be simple and robust.

请先登录,再进行评论。

回答(1 个)

cui,xingxing
cui,xingxing 2024-4-9
编辑:cui,xingxing 2024-4-27
Hi,@진회
In fact, you don't need to do 2-statge passing in and out of multiple variables for your model output in simulink, you can just do it in one step, i.e., use the Matlab Function block directly in simulink to handle your subsequent tasks.
-------------------------Off-topic interlude, 2024-------------------------------
I am currently looking for a job in the field of CV algorithm development, based in Shenzhen, Guangdong, China. I would be very grateful if anyone is willing to offer me a job or make a recommendation. My preliminary resume can be found at: https://cuixing158.github.io/about/ . Thank you!
Email: cuixingxing150@gmail.com
  1 个评论
진회
진회 2024-4-9
thank you for answer!
but, what i am interesting is matlab script not simulink.
i find that evalin is the answer. thank you!

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Startup and Shutdown 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by