I follow MathWorks tutorial on converting MATLAB code to C code. The first step is to enter
% # Codegen
after every function that I want to convert to C code, however this gave me the following hint for the code below.
function lanes=find_lanes(B,h, stats)
% Find the regions that look like lanes
%#codegen
lanes = {};
l=0;
for k = 1:length(B)
metric = stats(k).MajorAxisLength/stats(k).MinorAxisLength;
%testlane(k);
%end
%function testlane(k)
coder.inline('never');
if metric > 5 & all(B{k}(:,1)>100)
l=l+1;
lanes(l,:)=B(k);
else
delete(h(k))
end
end
end
around braces:
code generation only supports cell operations for "varargin" and "Varargout"
Another invitation says
Code generation does not support the growth of the size of the "tracks" of a variable by indexing
where the bands are mentioned for the second time.
Input arguments to the function:
B. bwboundaries Image Processing toolbox. P-by-1, P - . Q-by-2. . Q - .
h - , 1 X length (B), , :
h(K)=plot(boundary(:,2), boundary(:,1), 'g', 'LineWidth', 2);
- 19x1, regionprops : MajorAxisLength MinorAxisLength ()
, , . Advance!