Function Error [scipt works, as interpreted function not]

1 visualizzazione (ultimi 30 giorni)
Dear Team,
I have really annoying problem related to function.
I have 2 inputs for my function:
fncc.JPG
prob_ego input is aray: u = [a b c d e f]
location_ego is int loc
output : out = [g h i j k l] (each output is matrix [2x15] and converted to [1x30] by matlab.
If I don't use location_ego input; there isn't any problem. When I use that input (to calculate outputs), I receive error in Simulink although when I run as script; it works without error.
I use inputs of function as both :
function oout = prr(u)
a=u(1);
b=u(2);
c=u(3);
d=u(4);
e=u(5);
f=u(6);
g=u(7);
function oout = prr(u,g)
a=u(1);
b=u(2);
c=u(3);
d=u(4);
e=u(5);
f=u(6);
Error message what is received:
Invalid setting for input port dimensions of 'prrdeneme/Demux'. The dimensions are being set to 1.
This is not valid because the total number of input and output elements are not the same
Error in port widths or dimensions. Output port 1 of 'prrdeneme/Interpreted MATLAB Function' is a one
dimensional vector with 1 elements.
But I don't receive this error when I run the function as script.
Thank you in advance for your answers.
Best regards.

Risposta accettata

Hakan Basargan
Hakan Basargan il 4 Ott 2019
I solved my problem by adding Signal Specification block output between demux and interpreted function.
Thanks

Più risposte (0)

Categorie

Scopri di più su Simulink in Help Center e File Exchange

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by