導航:首頁 > 五金知識 > 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工具箱相關的資料

熱點內容
機械整機設計怎麼樣入手 瀏覽:34
連接三角帶的軸承叫什麼 瀏覽:986
word201364位工具箱 瀏覽:383
寧海縣有那些五金市場 瀏覽:325
戰艦世界工具箱國服 瀏覽:174
南方水暖達柏林閥門怎麼樣 瀏覽:960
工業機床需要什麼材料 瀏覽:222
手持電動工具RCD 瀏覽:446
元器件自動上料裝置 瀏覽:510
軟體管理工具箱 瀏覽:699
角接觸球軸承背對背安裝如何減小軸向力 瀏覽:757
自動噴水系統末端試水裝置 瀏覽:291
電腦上機械制圖需要下載什麼軟體下載 瀏覽:364
切割鐵皮用什麼電動工具 瀏覽:77
a6l儀表盤小公里數怎麼消除 瀏覽:28
天然氣閥門批發 瀏覽:168
氣管三通屬於五金件嘛 瀏覽:527
電子水表閥門打不開怎麼恢復 瀏覽:986
狼蛛機械鍵盤怎麼辨別真假 瀏覽:460
浙江有哪些大型機械工業 瀏覽:141