I wonder if any of you MATLAB whizzes out there can help me with this...

I have two 2-D matrices of the same size. They show distribution of

radiation in a target. The distributions are pretty much smooth, and mostly

hill-like, i.e. maximum is near the centre. Values range from 0 to 150

double-precision values.

The two matrices look very similar, but are generated from a simulation with

slightly different inputs. One way to compare the distributions is by

absolute or relative difference - that's easy. Another way is

distance-to-agreement (DTA).

DTA works like this: For each position in matrix 1, we want the distance

from the corresponding position in matrix 2 to the nearest position in

matrix 2 with the same value as the posiiton in matrix 1. Basically, we

have to plot contours of the distributions, and the contours have to match

within a certain distance tolerance, and I'm looking at how to calculate

that distance.

The only way I've yet to come up with is to calculate the distance to every

position, and it's value, then take the nearest one of the same value (or

within a 0.1 value threshold). However, this is order n-squared cacluation

time, and the matrices can get quite large (400x400 or so).

Any quicker ways of doing it?

--

Ian Cowley (Not Reverend) - Perfecting pedantry through practice

Check www.iancowley.co.uk for contact details!

"Some people don't understand statistics" - Ciaran Byrne