導航:首頁 > 五金知識 > 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