Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/matlab/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/redis/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Matlab 如何在二维平面上绘制Wi-Fi信号强度的热图?_Matlab_Plot_Heatmap - Fatal编程技术网

Matlab 如何在二维平面上绘制Wi-Fi信号强度的热图?

Matlab 如何在二维平面上绘制Wi-Fi信号强度的热图?,matlab,plot,heatmap,Matlab,Plot,Heatmap,我的数据集如下所示(例如): 这里,强度是以dBm为单位的接收信号强度,X和Y是二维坐标。我想画出所有坐标点的信号强度热图 我的情况与问题类似。但是,我想在Matlab中绘制接收信号强度和,如附图所示(因为图片质量)。在Matlab中找到了一个解决方案,但是,链接中给出的代码不起作用。Matlab的命令窗口显示0行0列的热图对象。Matlab中的可用代码如下所示: strength = [-90 -90 -90 -90 -40 -20 -22.4 -45 -35 -41 -44 -55 -40

我的数据集如下所示(例如):

这里,
强度
是以dBm为单位的接收信号强度,X和Y是二维坐标。我想画出所有坐标点的信号强度热图

我的情况与问题类似。但是,我想在Matlab中绘制接收信号强度和,如附图所示(因为图片质量)。在Matlab中找到了一个解决方案,但是,链接中给出的代码不起作用。Matlab的命令窗口显示0行0列的热图对象。Matlab中的可用代码如下所示:

strength = [-90 -90 -90 -90 -40 -20 -22.4 -45 -35 -41 -44 -55 -40 -75 -26]';
X = [10 550 550 10 50 234 393 129 237 328 448 225 344 457 477]';
Y = [10 10 410 410 293 210 202 132 130 142 141 272 268 274 200]';
strengthPercent = 2*(strength+100)/100;
picture = imread('https://www.mathworks.com/help/examples/thingspeak/win64/CreateHeatmapOverlayImageTSExample_02.png'); 
[height,width,depth] = size(picture);
OverlayImage=[];
F = scatteredInterpolant(Y, X, strengthPercent,'linear');
for i = 1:height-1
   for j = 1:width-1
          OverlayImage(i,j) = F(i,j);
   end
end
alpha = (~isnan(OverlayImage))*0.6;

imshow(picture);
hold on
OverlayImage = imshow( OverlayImage );
caxis auto  
colormap( OverlayImage.Parent, jet );
colorbar( OverlayImage.Parent );
set( OverlayImage, 'AlphaData', alpha );
有什么建议吗

多谢各位


您可以像您显示的代码一样使用
散射Interpolant
,只需将其与
冲浪

F = scatteredInterpolant(X(:), Y(:), strength(:));
[XD, Yd] = meshgrid( 0:10:410, 0:10:550 );
Zd = F( XD, Yd );
surf( XD, Yd, Zd, 'EdgeColor', 'interp' );
view([0,90]); % view 3D plot from above
您可以更改
colormap
以自定义外观

colormap( 'hot' );
colorbar();
您应该能够减少曲面的
FaceAlpha
,将其放置在图像上。

请在帖子中添加一个,因为现在我们无法看到您是如何绘制地图的。
colormap( 'hot' );
colorbar();