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

熱點內容
玻璃儀器洗用什麼溶液 瀏覽:167
頎中科技設備工程師多少錢一個月 瀏覽:391
多功能輔助工具箱 瀏覽:128
機械過濾器驗收報告怎麼寫 瀏覽:775
電工實驗裝置紅黃綠 瀏覽:194
翰浴軒閥門產品怎麼樣 瀏覽:691
鞍馬健身器材怎麼用 瀏覽:56
測萘的熔點的實驗器材有哪些 瀏覽:378
大五金件鑲入注塑 瀏覽:143
ubuntu怎麼查看設備號 瀏覽:223
數控機床n10什麼意思 瀏覽:171
台式電腦上連麥需要什麼設備 瀏覽:755
壓力檢測儀表怎麼畫 瀏覽:847
一立方製冷量多少為合適 瀏覽:678
如何計算設備功率 瀏覽:289
水處理設備有哪些 瀏覽:602
自動排氣閥前要安裝閥門嗎 瀏覽:336
肋骨下隱隱作痛用什麼儀器 瀏覽:287
軸承怎麼樣查型號 瀏覽:111
東莞聯華五金製品有限公司怎麼樣 瀏覽:623