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

📄 or.m~

📁 CheckMate is a MATLAB-based tool for modeling, simulating and investigating properties of hybrid dyn
💻 M~
字号:
function U = or(v1,v2)% Union of two vertices objects %% Syntax:%   "vtcs = or(v1,v2)"%%   "vtcs = v1 | v2"%% Description:%   "or(v1,v2)" returns a vertices object containing all unique points%   from "v1" and "v2". %% Examples:%   Given a vertices object, "v1" 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 4 4"%%   "1 3 3 1"%%   "2 2 2 2];"%%   "vtcs = v1 | v2"%%%%   returns "vtcs" a vertices object representing a cube with corners at%   (x1,x2,x3) triples (2,1,0), (2,3,0), (4,3,0), (4,1,0), (2,1,2),%   (2,3,2), (4,3,2), and (4,1,2).%% See Also:%   vertices,and U = vertices; %assumeif ~isa(v2,'vertices')  v2 = vertices(v2);endif ~isempty(v1) && ~isempty(v2) && (dim(v1) ~= dim(v2))  disp('VERTICES/OR: different dimensions given')  returnend  point_tol = parameters.poly_point_tol;N1 = length(v1);N2 = length(v2);if (N1 == 0)  U = v2;  returnendif (N2 == 0)  U = v1;  returnendU = [v1 v2];noDuplicate = true(length(U),1);for k = 1:N2  found = false;  v2k = v2.list(:,k);  for l = 1:N1    v1l = v1.list(:,l);    diff = (v1l-v2k);    if (diff'*diff < point_tol)      found = true;      break;    end  end  if found    noDuplicate(N1+k) = false;  endendU = vertices(U.list(:,noDuplicate));

⌨️ 快捷键说明

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