Variable Size signal and upper bounds
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Hi, I have this simple exemplary code in a Matlab Embedded Simulink Function (Matlab 2012b)
function y = myfun(n)
coder.varsize('y', [1 1024]);
y = zeros(1,n);
I have also declared y to be a variable-size output.
But when running the model he keeps complaining:
"Output 'y' (#404) has variable size but the upper bound is not specified; explicit upper bound must be provided."
What am I doing wrong?
Thanks for your kind help.
Chris
0 comentarios
Respuestas (2)
Sankirna Joge
el 12 de Nov. de 2016
Editada: Walter Roberson
el 13 de Nov. de 2016
hello, i am also getting the same error but here i am passing image information to output in simulink ..
i defined
coder.varsize('y4',[0,255]);
where, y4 = [ x1, x2, x3, x4];
where, x1 = im2double(I1);
where, I1 = imread('one.jpg');
similar for x2,x3 and x4 also with their respective I2, I3, I4 values and then y4 passed to video viewer block
where i am failing to solve it ?
0 comentarios
Milad Kahrobaee
el 26 de En. de 2018
You can work around it by:
function y = myfun(n)
assert (n <= 6);
y = zeros(1,n);
you should set the upper bounds for the output ("Y") in the "Edit Data" ("Size" section) and of course you should check the "Variable Size" checkbox.
Go to this link for more info: https://www.mathworks.com/help/fixedpoint/ug/variable-size-data-when-dynamic-memory-allocation-is-disabled.html
0 comentarios
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!