使用网格物体时确定垃圾箱的中心 [英] Determine center of bins when using meshm

查看:91
本文介绍了使用网格物体时确定垃圾箱的中心的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I am using meshm to plot densities. How do I calculate the center point for each of the bins? I want to associate the data in m with the centerpoints I have looked at the source code of meshm and believe the solution will be a modified version of meshm that returns the latitude and longitudes of each bin's center point.

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

meshm calls the function meshgrat which returns the latitude and longitude points of the mesh that will be plotted by surfacem. The problem is that the lat and lon matrices are not the same size as m. I need to match the latitude and longitude points with the density data in m I believe I need to scale the data based on GRATSIZE a variable in meshgrat.

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

NOTE: meshm is part of the Matlab Mapping Toolbox

注意:这是对确定距Matlab海岸线的距离的后续问题

推荐答案

meshm内,只需将输入修改为meshgrat:

Within meshm just modify the inputs to meshgrat:

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

默认情况下,gratsize = [](在meshgrat中)将返回默认的标线大小50 X100.如果不传入gratsize,则将标线设置为与Z相同的大小.

By default, gratsize = [] which in meshgrat will return the default graticule size of 50 X 100. By not passing in gratsize, the graticule is set to the same size as Z.

这篇关于使用网格物体时确定垃圾箱的中心的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆