Making an array for a density plot

2 views (last 30 days)
Joydeb Saha
Joydeb Saha on 27 Apr 2020
I have 619209x1 double Latitude and 619209x1 double Longitude. The maximum lat value is 83.40 and minimum lat value is -79.83. similarly max long value is 179.99 and min long vaue is -179.99. Depending on their max min value I have made a dummy matrix of 155x360 double. Now, I need a code where , say lat value is 2.25 and long value is 2.75, a loop will add (place) 1 at the 2x2 cell. similarly say lat value is 2.75 and lng value is 2.88 then at the 2x2 cell there will be addding up, i.e, 1+1 =2 . This thing will continue for each of the numbers in the lat and long depending on the first digit before the decimal. e.g, lat = 85.44 and lon = 85.14, there will be +1 in the 88th cell. This is required for a density plot.

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!