Why do I get an error when converting my MATLAB code (which utilizes "bwlabel") to C code using MATLAB Coder?
Show older comments
I am trying to generate C/C++ code from my MATLAB program, which utilizes "bwlabel".
However, I encounter the following error message:
??? Computed maximum size of output #1 of function 'intermediateLabelRuns' is not bounded.
Static memory allocation requires all sizes to be bounded.
The computed size is [:? x 1].
Please consider enabling dynamic memory allocation to allow unbounded sizes.
Here is an excerpt of my example code:
im_bin = zeros(dim_X,dim_Y);
coder.varsize('im_bin');
for idx=1:dim_X
for idy = 1:dim_Y
if (im(idx,idy) < threshold)
im_bin(idx,idy) = 0;
else
im_bin(idx,idy) = 1;
end
end
end
[label, nblabel] = bwlabel(im_bin, 4);
Accepted Answer
More Answers (0)
Categories
Find more on MATLAB Coder in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!