Mapping 使用meshm时确定料仓中心

Mapping 使用meshm时确定料仓中心,mapping,latitude-longitude,matlab,Mapping,Latitude Longitude,Matlab,我正在使用meshm绘制密度。 如何计算每个箱子的中心点?我想将m中的数据与中心点相关联我已经查看了meshm的源代码,并相信解决方案将是meshm的修改版本,该版本返回每个箱子中心点的纬度和经度 meshm调用函数meshgrat,该函数返回将由surfacem绘制的网格的纬度和经度点。问题是lat和lon矩阵的大小与m不同我需要将纬度和经度点与m中的密度数据相匹配我相信我需要根据GRATSIZE在meshgrat中调整变量的大小来缩放数据 注:是Matlab映射工具箱的一部分 注意:这是对的

我正在使用
meshm
绘制密度。 如何计算每个箱子的中心点?我想将m中的数据与中心点相关联我已经查看了
meshm
的源代码,并相信解决方案将是
meshm
的修改版本,该版本返回每个箱子中心点的纬度和经度

meshm
调用函数
meshgrat
,该函数返回将由
surfacem
绘制的网格的纬度和经度点。问题是lat和lon矩阵的大小与m不同我需要将纬度和经度点与m中的密度数据相匹配我相信我需要根据GRATSIZE在
meshgrat
中调整变量的大小来缩放数据

注:是Matlab映射工具箱的一部分


注意:这是对

的后续问题,您可以使用来获取网格的边缘,这是
meshm
在生成网格进行装箱时调用的函数

%# create the mesh that is used by meshm
[latgrat,longrat] = meshgrat(m,termaplegend);
%# find the latitudes of the center points
latPts = (latgrat(1:end-1,1:end-1) + latgrat(2:end,1:end-1))/2;
%# find the longitudes of the center points
lonPts = (longrat(1:end-1,1:end-1) + longrat(1:end-1,2:end))/2;

第二排第五列的料仓中心是
[latPts(2,5),lonPts(2,5)]
meshm
中,只需将输入修改为
meshgrat

[lat,lon] = meshgrat(Z, R, gratsize); % original 
[lat, lon] = meshgrat(Z,R); % modification

默认情况下,
gratsize=[]
在meshgrat中将返回默认的分划大小50 X 100。通过不传入gratsize,分划被设置为与Z相同的大小。

在上述示例中,latPts和lonPts是双矩阵。我想将中心点与m中的数据相匹配