資源簡介
空間泊松點過程畫圖 泰森多邊形 matlab
代碼片段和文件信息
%%%%?-----PPP作圖-----?%%%%
%%%%?Part1?%%%%
Lambda?=?20;??%?Lambda:poisson(Lambda)
v?=?exp(-Lambda)???%判定條件
u?=?unifrnd(01)
N?=?0;
while?u?>=?exp(-Lambda)
????u?=?u*unifrnd(01);
????N=N+1;
end?
N????%取點個數
poissrnd(Lambda1N)
%?%?POISSON點的分布圖
%?x?=?0:N;
%?y?=?poisspdf(xLambda);
%?plot(xy‘+‘)
%%%%?Part2?%%%%
a?=?0;c?=?0;b?=?100;d?=100;%取[0100]*[0100]的布點區域;
M?=?N;
%?A?=?[];
%?B?=?[];
while?N?>?0??????%%scatter?in?the?[0100]*[0100]
????N?=?N-1;
????u1?=?unifrnd(01);
????A(M-N)?=?(b-a)*u1;
????u2?=?unifrnd(01);
????B(M-N)?=?(d-c)*u2;
????figure(1)?????%%base?stations?分布圖
????plot(A(M-N)B(M-N)‘rP‘);
????hold?on;
end
%Voronio作圖
figure(2)???%poisson-voronio圖
[VxVy]?=?voronoi(AB);
h?=?plot(VxVy‘-‘AB‘rP‘);
set(h(1:end-1)‘xliminclude‘‘off‘‘yl
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????1004??2020-07-27?16:28??PPP_Vor.m
評論
共有 條評論