How to use a Matlab script in a Simulink Matlab Function Block, that is calling Matlab Functions.
17 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Respuestas (1)
Fangjun Jiang
el 23 de Mzo. de 2020
Editada: Fangjun Jiang
el 23 de Mzo. de 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 comentarios
Ver también
Categorías
Más información sobre Simulink Functions en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!