How to use a Matlab script in a Simulink Matlab Function Block, that is calling Matlab Functions.
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I hope, that i somehow can make clear what my problem is:
I do have a Simulink Model. Within this model I wan't to create a Matlab Function Block. The Matlab script, that I want to insert into the Matlab Function Block is already existing. This existing script is calling 9 different Matlab functions, that I need for computing my problem.
How do i make this work? I have to make keep the Matlab "script" and the called "functions" separate, otherwise my script would get way to big.
0 Kommentare
Antworten (1)
Fangjun Jiang
am 23 Mär. 2020
Bearbeitet: Fangjun Jiang
am 23 Mär. 2020
You can certainly do that. Just figure out the input/output of your script and make it the top-level function of your MATLAB Function block. In this simple example, you can call abs() which is a MATLAB function. You can also call MyOtherFun() which is your own function, saved in MyOtherFun.m file.
function y = fcn(u)
y =MyOtherFun(u);
y= abs(y);
0 Kommentare
Siehe auch
Kategorien
Mehr zu Simulink Functions finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!