Variables scope in MatLab function block
2 次查看(过去 30 天)
显示 更早的评论
Hello everyone,
I have a simulink file, in which I'm using a matlabFunction block, this function is calling several other functions and files including some structures in the same path, but whenever I run the simulation, the variables that are defined in the workSpace are not visible for the "matlab function" block, is there any way of changing their scope or any approach to fix this other than having to re-define all the variables locally within that block?
0 个评论
采纳的回答
Fangjun Jiang
2021-2-22
Use "Edit Data" in the MATLAB Function Editor to specify those base workspace variables as the parameters
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Simulink Functions 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!