Variable Size signal and upper bounds
1 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(2 个)
Sankirna Joge
2016-11-12
编辑:Walter Roberson
2016-11-13
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 个评论
Milad Kahrobaee
2018-1-26
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 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!