I have a list of around 100 matrices, that looks like this
A={{{425060., 2.14235*10^6, 0.49, 0.01, 0.38, 0.620161,
20.}, {1.24808*10^6, 1.53025*10^6, 0.04, 0.07, 0.31, 0.320312,
20.}, {7.39304*10^6, 1.40204*10^6, 0.83, 0.45, 0.09, 0.94842, 20.} .... {4.27537*10^6,
1.62124*10^6, 0.24, 0.28, 0.62, 0.721388, 20.1}, {3.27776*10^6,
2.25816*10^6, 0.01, 0.21, 0.72, 0.750067, 20.1}, {3.0814*10^6,
1.95624*10^6, 0.02, 0.19, 0.72, 0.744916, 20.1}, {2.42706*10^6,
1.25729*10^6, 0.03, 0.17, 0.7, 0.720972, 20.1}, {4.47196*10^6,
1.23247*10^6, 0.24, 0.27, 0.57, 0.674833, 20.1}, {1.57132*10^7,
1.65019*10^6, 0.76, 0.92, 0.5, 1.29383, 20.1} ......
Each matrix has an unknown number of rows. Each matrix holds information about a group of particles at a given time. Columns 3,4,5 are the x,y and z coordinate of each particle. For each matrix, I want to compare the Euclidean distance between every two particles, and keep the particle whose distance from all other particles in that matrix is greater than 0.01. I want to use the following algorithm, I pick a matrix, then pick its first row, then I check whether EuclideanDistance[{#3, #4, #5}, {from all other particles}]> 0.01 then that row (that particle) gets copied into another matrix, if not, then ignore both the elements for further computation. This way a new list of matrix will be created with particles which are at least 0.01 units away from each other.
EDIT : I am getting error messages EuclideanDistance::argr: EuclideanDistance called with 1 argument; 2 arguments are expected. >> Pick::incomp: Expressions {{1.13266*10^7,1.40618*10^6,0.82,0.67,0.35,1.11526,22.7}} and {EuclideanDistance[{0.82,0.67,0.35}]>0.01} have incompatible shapes. >> EuclideanDistance::argr: EuclideanDistance called with 1 argument; 2 arguments are expected. >> Pick::incomp: Expressions {{1.13266*10^7,1.38136*10^6,0.82,0.67,0.35,1.11526,22.8}} and {EuclideanDistance[{0.82,0.67,0.35}]>0.01} have incompatible shapes
this is happening when there is only one element in the matrix, as EuclideanDistance
requires two arguments. Is there any way I can have the Euclidean distance skip over these single elements, yet the fina list of matrices will have those single elements?