矩阵A的第i列 A(;,i)
矩阵A的第i行 A(i,:)
复制mxn个矩阵A B=repmat(A,m,n)
找到最小值以及索引 [min_value,index]=min(values)
两值比较大小返回0/1布尔值 a>b
PPP分布在2D空间:根据lambda均值生成点的个数n,然后n个点的坐标在x方向和y方向上满足均匀分布
代码:
function [matrix_UE_BS] = Model_Init(BS_lambda, UE_lambda, R)
clc;close all;
%INPUT: lambda of BS and UEs, the range of BS station
%OUTPUT: the map of UE and its corresponding BS.The first column is the closest BS index, the second column
% is the distance from UE to the closest BS, the third column is the service BS of UE.If the value in the third
%column is 0, that means there is no BS could provide service for UE.
%according to lambda, assign the position of BS and UE.
[BS_pos, BS_num]=poisson2d(BS_lambda);
[UE_pos, UE_num]=poisson2d(UE_lambda);
plot(BS_pos(:, 1), BS_pos(:, 2), 'pr');
hold on;
plot(UE_pos(:, 1), UE_pos(:, 2), '