导航:首页 > 五金知识 > mpt工具箱

mpt工具箱

发布时间:2021-02-02 19:25:05

① 用matlab mpt工具箱生成受限的voronoi图。请问该怎么得到各个顶点坐标呢(包括voronoi边与边界的交点)

extreme这个函数就可以得到顶点坐标。
给你个代码:
function irPoly = getIrreg(m,s)
%GETIRREGULAR Summary of this function goes here
% get irregular pixels
% the same begin & end
% clockwise order
% m - regular size
% S - low/high resolution

% get limit voronoi
x = gallery('uniformdata', [(m*s)^2 1], 0);
y = gallery('uniformdata', [(m*s)^2 1], 1);
vOut = [0,0; 0,m; m,m; m,0];
P = polytope(vOut);
Options.pbound = P;
% Options.plot = 1;
Pn = mpt_voronoi(m*[x,y],Options);

% split each polygon
for iPoly = 1:length(Pn)
thisPoly = extreme(Pn(iPoly));
% limited in [0,m]
thisPoly(thisPoly>m) = m;
thisPoly(thisPoly<0) = 0;
% make points in order
k = convhull(thisPoly(:,1), thisPoly(:,2));
% make clockwise
[pX,pY] = poly2cw(thisPoly(k,1),thisPoly(k,2));
irPoly{iPoly} = [pX,pY];
end%for iPoly

end%function

② matlab中如何给voronoi加个边界

代码如下
A=[100*rand(10,2)rand(10,1)];
pbound=polytope([000;15000;1501500;01500;001;15001;1501501;01501]);
Options.pbound=pbound;
Options.plot=1;
mpt_voronoi(A,Options);

③ 求2014a版的matlab中MPT工具箱

留个邮箱,我给你发到邮箱里边去。

④ Matlab的MPT工具箱

^extreme这个函数就可以得到顶点坐标。 给你个代码: function irPoly = getIrreg(m,s) %GETIRREGULAR Summary of this function goes here % get irregular pixels % the same begin & end % clockwise order % m - regular size % S - low/high resolution % get limit voronoi x = gallery('uniformdata', [(m*s)^2 1], 0); y = gallery('uniformdata', [(m*s)^2 1], 1); vOut = [0,0; 0,m; m,m; m,0]; P = polytope(vOut); Options.pbound = P; % Options.plot = 1; Pn = mpt_voronoi(m*[x,y],Options); % split each polygon for iPoly = 1:length(Pn) thisPoly = extreme(Pn(iPoly)); % limited in [0,m] thisPoly(thisPoly>m) = m; thisPoly(thisPoly<0) = 0; % make points in order k = convhull(thisPoly(:,1), thisPoly(:,2)); % make clockwise [pX,pY] = poly2cw(thisPoly(k,1),thisPoly(k,2)); irPoly{iPoly} = [pX,pY]; end%for iPoly end%function

⑤ 请问怎么用matlab画voronoi图,能否提供mpt_voronoi工具箱

⑥ matlab中生成voronoi图时,能否设定一个边界使得voronoi顶点不出现无穷远点

下个mpt工具箱
里面的_voronoi可以实现你的要求

MPT_VORONOI Computes the voronoi diagram via mpLP

[Pn]=mpt_voronoi(points,Options)

---------------------------------------------------------------------------
DESCRIPTION
---------------------------------------------------------------------------
The voronoi diagram is a partition of the state space; For a given set of
points pj, each region Pn(j) is defined as
Pn(j)={x \in R^n | d(x,pj)<=d(x,pi), \forall i \neq j}

---------------------------------------------------------------------------
INPUT
---------------------------------------------------------------------------
points - Optional input:
Matrix p times nx of points: nx is state space dimension and
p is the number of points
The entry is graphical in 2D if no parameters are passed.
Options.pbound - A "bounding polytope". If provided, the voronoi cells will
be bounded by this polytope. If not provided, the cells will
be bounded by a hypercube as big as 1.5x the maximum
coordinate of any of the seed points
Options.plot - If set to 1, plots the voronoi diagram (0 is default)
Options.sortcells - If set to 1, resulting Voronoi partition will be ordered
in a way such that Pn(i) corresponds to seed point i.
(Default is 1)

⑦ MATLAB的MPT工具箱如何安装,按照官网教程总是出错

matlab的工具箱安装其实很简单, 说白了就是设置一个路径让Matlab能找到工具箱里面的东西
方法是:
下载版工具箱
解压缩到一权个目录(任意的,随便你放哪里)
在File -> Set Path 里面把第2步的那个目录加到系统路径里面, 第二个按键 Add with Subfolders (见下图)
回到matlab命令行: 输入DemoPSOBehavior 不出错就成功了!

⑧ 用matlab画有边界的voronoi图,怎么画

估计你是刚刚加载吧,提示说MATLAB找不到路径,我当初加载神经网络的时候,和你的处境一样,我关了MATLAB,吃完饭一用,神奇的好了。望采纳。

⑨ matlab中生成voronoi图时,能否设定一个边界使得voronoi顶点不出现无穷远点

下个mpt工具箱
里面的mpt_voronoi可以实现你的要求

MPT_VORONOI Computes the voronoi diagram via mpLP

[Pn]=mpt_voronoi(points,Options)

---------------------------------------------------------------------------
DESCRIPTION
---------------------------------------------------------------------------
The voronoi diagram is a partition of the state space; For a given set of
points pj, each region Pn(j) is defined as
Pn(j)={x \in R^n | d(x,pj)<=d(x,pi), \forall i \neq j}

---------------------------------------------------------------------------
INPUT
---------------------------------------------------------------------------
points - Optional input:
Matrix p times nx of points: nx is state space dimension and
p is the number of points
The entry is graphical in 2D if no parameters are passed.
Options.pbound - A "bounding polytope". If provided, the voronoi cells will
be bounded by this polytope. If not provided, the cells will
be bounded by a hypercube as big as 1.5x the maximum
coordinate of any of the seed points
Options.plot - If set to 1, plots the voronoi diagram (0 is default)
Options.sortcells - If set to 1, resulting Voronoi partition will be ordered
in a way such that Pn(i) corresponds to seed point i.
(Default is 1)

阅读全文

与mpt工具箱相关的资料

热点内容
浇地地下管道阀门 浏览:311
佛山市国铝五金制品有限公司v 浏览:255
汽车仪表盘ch是什么单词 浏览:205
机械纪元怎么交易 浏览:798
机床5包和3包有什么区别 浏览:564
面部超声波怎么那么疼 浏览:244
上海坦克牌电动工具 浏览:312
跨临界直接制冷是什么原理 浏览:852
CAD化工PID阀门是怎么绘制的 浏览:762
电动工具连锁店 浏览:72
朔州五金贸易市场 浏览:32
设备锁密码忘记怎么弄 浏览:414
东莞市裕顺五金制品有限公司 浏览:910
自动加药装置价位 浏览:37
宝来车仪表盘怎么能看到油耗 浏览:561
温州博恒电子设备有限公司怎么样 浏览:588
三吨合力叉车仪表总成多少钱 浏览:724
上海五金机电市场招工 浏览:907
声控阀门排气怎么接线 浏览:147
水电装修工具箱 浏览:688