Sample rate for interpreted function

5 次查看(过去 30 天)
I am trying to get a continuous sample rate running using an inperpreted function. However, the interpreted function block doesn't have sample rate input. All the documentation I have read says to double click on the block and set the sample rate. Unfortunatly there is no input block for sample rate in the window. How do I do this?

回答(2 个)

Andrew Cruce
Andrew Cruce 2019-7-23
If you look in the Library Browser under User Defined Functions the one I am using is the Iterpreted MatLab Function. This block allows me to specify a MatLab function in the current folder to be executed. I know it works because when I run Simulink the function is executed and the proper inputs are passed to it. The only issue is that it can not be set for a continuous sample time. I'm trying to update an output in real time and needt the simulation to run continuously.
I have also looked at the "MATLAB Function" in the set of user defined functions but it doesn't allow me to specify a MATLAB function in the current folder to be executed. Instead, it requires the function to to coded in the function block.
Not sure what I am missing. Thanks for looking into this.

Andrew Cruce
Andrew Cruce 2019-7-23
I figured out how to use the "MATLAB Function" block to call my Matlab script in the same folder. I declared the function as extrinsic which worked but I still can't find anyway to set the sample time for the block and have it run continuously. I must be missing something simple.

类别

Help CenterFile Exchange 中查找有关 String 的更多信息

产品


版本

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by