I am using Matlab to process seismic data, each one of this assume that corresponds to a specific geographic point (known lat, long). One of the goals is to group points in the Earth's surface which are encompassed by bins of a specific radius (e.g r=10degrees). It doesn't matter if the bins are overlapping.
I have used the histr()
Matlab intrinsic function but this outputs the central coordinates in (lat,long) of the resulting bins and the number of data points included in a bin. However, I would also like to label the data points and be able to use these labelled data points in subsequent processing.
What I have used:
lt1=load('midlats.dat');
lg1=load('midlons.dat');
len_lt=length(lt1);
len_lg=length(lg1);
nb=1;
[clats,clons,num,wnum] = histr(lt1,lg1,nb);
In which nb defines how many bins you need per angular degree.
Is this anywhere close to my goal or I am completely missing the picture??? Anyone having come across something similar? Any help/comments will be much appreciated.
histc
can also return a index of which bin your data falls into, so you can keep track of what value is in what bin. – nkjt