⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 plotshapes.m

📁 asm工具箱
💻 M
字号:
%%%%%%%%%%%%%%%%%%%%%%%%%%
%(c) Ghassan Hamarneh 1999
%%%%%%%%%%%%%%%%%%%%%%%%%%

function PlotShapes(Xu,str,ContoursEndingPoints);
%function PlotShapes(Xu,str,ContoursEndingPoints);

%ColorsArray={'y*','m*','c*','r*','g*','b*','k*'};%stars
ColorsArray={'y' ,'m' ,'c' ,'r' ,'g' ,'b' , 'k'}; %continous


% m: 1st , 8th  , 15th ... shape
% c: 2nd , 9th  , 16th
% r: 3rd , 10th , 17th
% g: 4th    .
% b: 5th    . 
% k: 6th    . 
% y: 7th , 14th ,21st


NumContours=length(ContoursEndingPoints);
n=size(Xu,1);

hold on
for ind1=1:size(Xu,2),
   clr=ColorsArray{1+mod(ind1,length(ColorsArray))};
   StartPoint=1;
   for ind2=1:NumContours,
      %plot closed contour-ind2 of shape-ind1
      X=[Xu(StartPoint    :ContoursEndingPoints(ind2)    ,ind1);Xu(StartPoint    ,ind1)];
      Y=[Xu(StartPoint+n/2:ContoursEndingPoints(ind2)+n/2,ind1);Xu(StartPoint+n/2,ind1)];
      plot(X,Y,clr);
      StartPoint=ContoursEndingPoints(ind2)+1;
   end
end

title(str);


%n=size(Xu,1);
%hold on;
%for ind1=1:size(Xu,2),
   %for closed contour we add the first point at the end   
%   plot([Xu(1:n/2,ind1);Xu(1,ind1)],[Xu(n/2+1:n,ind1);Xu(n/2+1,ind1)],ColorsArray{1+mod(ind1,length(ColorsArray))});
   %for open contour
   %plot(Xu(1:n/2,ind1),Xu(n/2+1:n,ind1),ColorsArray{1+mod(ind1,length(ColorsArray))});
%end
%title(str);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -