From: "Colin " <>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Check if two shifted matrices are equal
Date: Thu, 6 Nov 2008 21:12:01 +0000 (UTC)
Organization: Harris Corporation Inc
Lines: 32
Message-ID: <gevmj1$sq0$>
References: <gevia6$2hk$> <vVIQk.3167$dy1.2828@newsfe01.iad>
Reply-To: "Colin " <>
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: 1226005921 29504 (6 Nov 2008 21:12:01 GMT)
NNTP-Posting-Date: Thu, 6 Nov 2008 21:12:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1567289
Xref: comp.soft-sys.matlab:499380

Walter Roberson <> wrote in message <vVIQk.3167$dy1.2828@newsfe01.iad>...
> Colin wrote:
> > I have two matrices that are 1 x 130943 and contain hex values.
> > I want to be able to verify that they are in fact identical matrices but only one is shifted
> > with respect to the other.
> Do you only need to know that they -are- identical (but perhaps shifted), or do you need to
> know the amount of the shift?
> And do you happen to have any constraint on how much shift there would be? For example,
> would it just happen to be the case that the shift would be by an even number of positions?
> Is there exactly 1 hex digit per array location?
> Would a fast "Not the same" or "Might be the same" be useful to you? e.g., are the
> arrays often different and being the same is the much less common case that you can
> afford to take longer to prove? For example, when two arrays are different, then
> their histograms would often be different, so if the histograms are different then
> you know [relatively quickly] that the arrays are not shifts of each other, and if
> the histograms are the same then you could run a more detailed test.
> -- 
> .signature note: I am now avoiding replying to unclear or ambiguous postings.
> Please review questions before posting them. Be specific. Use examples of what you mean,
> of what you don't mean. Specify boundary conditions, and data classes and value
> relationships -- what if we scrambled your data or used -Inf, NaN, or complex(rand,rand)?

Sorry and to address your other questions, the matrix could be shifted by any arbitrary integer number up to the size of the matrix minus 1.

There is a hex value at exactly every index.