Function Error [scipt works, as interpreted function not]
조회 수: 2 (최근 30일)
이전 댓글 표시
Dear Team,
I have really annoying problem related to function.
I have 2 inputs for my function:
![fncc.JPG](https://www.mathworks.com/matlabcentral/answers/uploaded_files/241116/fncc.jpeg)
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.
댓글 수: 0
채택된 답변
추가 답변 (0개)
참고 항목
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!