From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: finding simultaneous min of two matrices
Date: Tue, 7 Apr 2009 03:15:02 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 7
Message-ID: <gregfm$t3g$>
References: <greee3$mnt$>
Reply-To: <HIDDEN>
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: 1239074102 29808 (7 Apr 2009 03:15:02 GMT)
NNTP-Posting-Date: Tue, 7 Apr 2009 03:15:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1187260
Xref: comp.soft-sys.matlab:530929

"Dhritiman " <> wrote in message <greee3$mnt$>...
> 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 (L-infinity), 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