?? 7-5.m
字號:
rand('state',5);
x = rand(1,10);
y = rand(1,10);
subplot(131)
voronoi(x,y);
%繪制voronoi圖形
subplot(132)
[vx, vy] = voronoi(x,y);
plot(x,y,'r+',vx,vy,'b-'); axis equal
%應(yīng)用返回值繪制
subplot(133)
rand('state',5);
x=rand(10,2);
[v,c]=voronoin(x);
%返回值v參數(shù)為voronoi頂點(diǎn)矩陣
%返回值c參數(shù)為voronoi元胞數(shù)組
for i = 1:length(c)
if all(c{i}~=1)
patch(v(c{i},1),v(c{i},2),i);
% 應(yīng)用色圖 i.
%調(diào)用低級圖形對象函數(shù)patch塊操作
end
end
axis equal
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -