Determine the center of silos when using meshm

I use meshm to calculate densities. How to calculate the center point for each of the bins? I want to associate data in m with center points . I looked at the source code of meshm and believe that the solution will be a modified version of meshm that returns the latitude and longitude of each center point of the hopper,

meshm calls the meshgrat function, which returns the latitude and longitude points of the grid that will be displayed using surfacem . The problem is that the matrices lat and lon are not equal to the size m. I need to match the latitude and longitude points with the density data in m . It seems to me that I need to scale the data based on the GRATSIZE variable in meshgrat .

NOTE: meshm is part of the Matlab Mapping Toolbox.

NOTE NOTE This is the next question for determining the distance from the coastline in Matlab

0
mapping matlab latitude-longitude
source share
2 answers

Inside meshm just change the inputs to meshgrat :

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

By default, gratsize = [] , which in meshgrat will return the default mesh size of 50 X 100. Without going into gratsize, the mesh is set to the same size as Z.

0
source share

You can get the edges of the grid using MESHGRAT , which is a function called meshm when it makes the grid for binning.

 %# 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)] center in the second row, 5th column [latPts(2,5),lonPts(2,5)] .

+1
source share

All Articles