[英]3-D plot of spikes in graph matlab
What would be the best way to get an image similar to the one below. 获得与以下图像相似的图像的最佳方法是什么。 Here is my data set. 这是我的数据集。
xx = [50 93 32];
yy = [93 63 42];
zz = [0.443 0.743 0.302];
Where xx
is Elevation(theta), yy
is Azimuth(phi), and zz
is HSH-MVDR. 其中xx
是海拔(θ), yy
是方位角(phi), zz
是HSH-MVDR。 I have been doing contour3
and surf
command but keep getting the error: "Z must be a matrix, not a scalar or vector." 我一直在执行contour3
和surf
命令,但contour3
收到错误:“ Z必须是矩阵,而不是标量或向量。” Points that are not in the dataset I want to be 0 for cordinates zz
, so I am expecting only 3 points to have spikes. 对于坐标zz
,我希望数据集中的点不为0,所以我希望只有3个点具有尖峰。
Just make a meshgrid (making sure your x,y indices are included) 只需制作一个网格(确保包括您的x,y索引)
[x,y]=meshgrid(0:100,0:400);
create z
创建z
z=zeros(size(x));
and fill it 并填充它
z(sub2ind(size(z),xx,yy))=zz;
then plot 然后画
surf(x,y,z) % surf(x,y,z,'linestyle','none');shading interp; ?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.