Assign workspace variable during runtime
5 次查看(过去 30 天)
显示 更早的评论
Hello everybody,
I want to change a Variable from Simulink Workspace during runtime through a Matlab function. Does anyone know how to implement this ?
Thanks in advance,
Thomas
2 个评论
回答(1 个)
Rishabh Mishra
2020-11-4
Hi,
You may use the MATLAB Function Block available in Simulink. Double click on the scenario canvas and type ‘MATLAB Function’ and then select the first block in the search list. On double clicking on the MATLAB Function Block, you can define the required function in MATLAB script editor.
Use the 'Constant block' in Simulink with it's value as workspace variable along with the MATLAB Function block to process the workspace variable during simulation runtime.
For better understanding of the MATLAB function block, refer the following link:
Hope this helps.
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!