Input/Output dimension error using Mux and Interpreted MATLAB Fcn

11 Ansichten (letzte 30 Tage)
Hi there,
I'm having a problem using the Interpreted MATLAB Fcn block. My mux has 4 inputs and (strangely) 2 outputs. I believe this is a backtrace error coming from the Interpreted Fcn block, which I believe is assuming only 2 inputs as well. I don't know why it is behaving like this. I have used this block several times in the past and it always worked well for 2 inputs. This is the first time I'm using more two inputs, so I'm not sure if this block has some kind of limitation in that sense.
I'm attaching the Simulink model, the Matlab function used in the Interpreted Fcn block and the errors I'm getting.
-------Simulink Model:
-------- Function used in Interpreted Function block:
--------The error I'm getting when trying to run the simulation
Thanks in advance for your help,
Alessio Silva

Akzeptierte Antwort

Ameer Hamza
Ameer Hamza am 17 Mai 2020
Instead of Interpreted Fcn block, you can use the MATLAB function block: https://www.mathworks.com/help/releases/R2020a/simulink/slref/matlabfunction.html which is much flexible to use.
  3 Kommentare
Alessio Silva
Alessio Silva am 20 Mai 2020
Worked perfectly with the MATLAB function block! Thanks for the help Ameer :)

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Simulink Functions finden Sie in Help Center und File Exchange

Produkte


Version

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by