unique.m

来自「一个matlab的将军模型」· M 代码 · 共 43 行

M
43
字号
function u = unique(v)

% Remove all redundant points from a vertices object 
%
% Syntax:
%   "V = unique(vtcs)"
%
% Description:
%   "unique(vtcs)" returns a vertices object containing the points from
%   "vtcs" with all repetitions removed.
%
% Examples:
%   Given a vertices object, "vtcs" representing a square in the x3 = 0
%   plane with corners at (x1,x2) pairs (2,1), (2,3), (4,3), and (4,1), 
%
%
%
%   "v2 = ["
%
%   "2 2"
%
%   "1 3"
%
%   "0 0];"
%
%   "vtcs = [vtcs v2];"
%
%   "V = unique(vtcs)"
%
%
%
%   returns "V" a vertices object representing the same square but
%   containing two less points than the modified vtcs.
%
% See Also:
%   vertices 

u = vertices;
for k = 1:length(v)
  vk = v.list(:,k);
  u = u | vk;
end

⌨️ 快捷键说明

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