Sample rate for interpreted function

3 visualizzazioni (ultimi 30 giorni)
Andrew Cruce
Andrew Cruce il 23 Lug 2019
Risposto: Andrew Cruce il 23 Lug 2019
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?

Risposte (2)

Andrew Cruce
Andrew Cruce il 23 Lug 2019
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 il 23 Lug 2019
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.

Categorie

Scopri di più su Simulink in Help Center e File Exchange

Prodotti


Release

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by