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

📄 showpoly.m

📁 Matlab程序
💻 M
字号:
function hh = ShowPoly(p,varargin)

assert('( size(p,1)==2 ) | ( size(p,1)==3 )')
assert('size(p,2)>=3')

% if (size(p,1)>3)
%     warning('Transposing so that vertices are columns')
%     p=p.';   
% end

if (nargin==1)
    
    if (size(p,1)==2)
        out=patch(p(1,:)',p(2,:)','g');
    end
    
    if (size(p,1)==3)
        out=patch(p(1,:)',p(2,:)',p(3,:)','g');
    end
    
    if ( nargout > 0 )
        hh = out;
    end
    return
end


if (size(p,1)==2)
    out=patch(p(1,:)',p(2,:)','r',varargin{:});
end

if (size(p,1)==3)
    out = patch(p(1,:)',p(2,:)',p(3,:)','r',varargin{:});
    
    %out = patch( p(1,:)', p(2,:)', p(3,:)', varargin{:} );
    
    %Some problems are caused by using the wrong choice of the  above two lines
    %different choices work in different situations
end


if ( nargout > 0 )
    hh = out;
end

⌨️ 快捷键说明

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