Using the "display()" command from a "Matlab Function Block" in simulink?
显示 更早的评论
i am trying to use the "display()" command in simulink by simply creating a "Matlab function block" and just writing the display command in it.
i get the following error :
"Undefined function or variable 'display'.
Function 'Bit Generation/MATLAB Function' (#182.47.57), line 3, column 1: "display(u)" "
i understand that not all matlab functions can be called from the Matlab function block. kindly tell me how to do what i am trying to do regards khurram
回答(1 个)
A Jenkins
2014-9-8
0 个投票
Use disp() instead.
4 个评论
khurram
2014-9-8
A Jenkins
2014-9-8
Are you using an older version? disp() is supported in 2013b for sure.
On 2010a, I had to declare it extrinsic:
eml.extrinsic('disp')
khurram
2014-9-8
It depends on when you want the code to run and how you plan to trigger it.
Go to "File->Model Properties" and select Callbacks and you will see different model actions that can trigger code to run. For example, put m-code in the "StartFcn" and it will run once at the start.
You can also try using the Interpreted MATLAB Function block, or just the plain Fcn block.
There are other ways to trigger by setting up events and listeners, but they are significantly more effort.
类别
在 帮助中心 和 File Exchange 中查找有关 Introduction to Installation and Licensing 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!