Sample rate for interpreted function

조회 수: 9 (최근 30일)
Andrew Cruce
Andrew Cruce 2019년 7월 23일
답변: Andrew Cruce 2019년 7월 23일
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