Input/Output dimension error using Mux and Interpreted MATLAB Fcn

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

 Accepted Answer

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 Comments

Thank you Ameer for your reply. I'll give it a try.
Worked perfectly with the MATLAB function block! Thanks for the help Ameer :)

Sign in to comment.

More Answers (0)

Categories

Products

Release

R2019a

Community Treasure Hunt

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

Start Hunting!