1 Star 0 Fork 0

xingchigang/WiFi-MATLAB-Simulator

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
displayDevsMap.m 1.04 KB
一键复制 编辑 原始数据 按行查看 历史
Lilach99 提交于 2020-05-15 19:28 . Add files via upload
function [] = displayDevsMap(numDevs, dists)
%plots the devices positions in a (x,y) plane - a network map
switch numDevs
case 2
X = [0, dists(1, 2)];
Y = [1, 1];
textCell = {'Device 1', 'Device 2'}; %arrayfun(@(x,y) sprintf('(%3.2f, %3.2f)', x, y), X, Y, 'un', 0);
case 4
X = [0, 0, dists(1, 3), dists(2, 4)];
Y = [0, dists(1, 2), 0, dists(3, 4)];
textCell = {'Device 1', 'Device 2', 'Device 3', 'Device 4'};
case 6
X = [0, 0, dists(1, 3), dists(2, 4), dists(1, 5), dists(2, 6)];
Y = [0, dists(1, 2), 0, dists(3, 4), 0, dists(5, 6)];
textCell = {'Device 1', 'Device 2', 'Device 3', 'Device 4', 'Device 5', 'Device 6'};
otherwise
fprintf('Number of devices can be 2, 4 or 6 only!');
end
scatter(X, Y, 'filled');
for i=1:numDevs
text(X(i)+.02, Y(i)+.02, textCell{i}, 'FontSize', 8);
end
title("Network Map (kms)");
end
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/xingchigang/WiFi-MATLAB-Simulator.git
git@gitee.com:xingchigang/WiFi-MATLAB-Simulator.git
xingchigang
WiFi-MATLAB-Simulator
WiFi-MATLAB-Simulator
master

搜索帮助

23e8dbc6 1850385 7e0993f3 1850385