"Dhritiman " <dhritimanbhattacharya@uiowa.edu> wrote in message <greee3$mnt$1@fred.mathworks.com>...
> Identifying a unique solution to a pair of non linear questions IN X & Y (SUPPOSE IN THEORY i KNOW THEY HAVE A UNIQUE SOLUTION GIVEN SOME PARAMATER VALUES)
> I DEFINE AN X GRID AND A Y GRID . I construct two n by n square matrix, one for each equation. Each of these matrices will have more than one element very close to zero (.1^4). They represent different values of x and y which satisfy the equations separately. However I want to find the common row and coloum number (i,j) where the element in each matrix is within a tol(<.1^4).(WHich is the solution to the set of questions) Please help me write a code to identify the unique i and j.
To give a decent solution to this kind of problem, you need a single measure of the "closeness to zero" of a pair of corresponding values from the two matrices. This can be any of a great variety of differently defined "distances" according to your tasttes. It could be the square root of the sum of the squares of their values (L2), the sum of their absolute values (L1), the maximum of their absolute values (Linfinity), or many other possibilities. Once you have selected such a measure, just apply the 'min' function (twice) to find the location of the minimum of such distances.
Roger Stafford
