Code covered by the BSD License  

Highlights from
C/C++ and Matlab types convertor

image thumbnail

C/C++ and Matlab types convertor

by

 

31 Jul 2008 (Updated )

Bidirectional conversion between C/C++ type (STL, openCV) and Matlab matrix (compile or run time)

draw_points (pnts)
function draw_points (pnts)
%DRAW_POINTS
% draw points one by one in a new figure
% usages:
%   draw_points(pnts);
% pnts must be a Mx2 double matrix

M = size(pnts, 2);
if (M~=2 || ~isa(pnts,'double')) 
    error('pnts must be a Mx2 double matrix');
end
hfig = figure;
hax = axes('parent', hfig);
plot(pnts(:,1),pnts(:,2),...
    'parent', hax,...
    'linestyle', 'none',...
    'marker', 'o');
axis('square');
set(hfig, 'name', 'example: view user-defined data type');

Contact us