Input/Output dimension error using Mux and Interpreted MATLAB Fcn

10 vues (au cours des 30 derniers jours)
Alessio Silva
Alessio Silva le 17 Mai 2020
Commenté : Ameer Hamza le 20 Mai 2020
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

Réponse acceptée

Ameer Hamza
Ameer Hamza le 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 commentaires
Alessio Silva
Alessio Silva le 20 Mai 2020
Worked perfectly with the MATLAB function block! Thanks for the help Ameer :)
Ameer Hamza
Ameer Hamza le 20 Mai 2020
I am glad to be of help!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Simulink Functions dans Help Center et File Exchange

Produits


Version

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by