Path: news.mathworks.com!not-for-mail
From: "Colin " <colinzhe@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Check if two shifted matrices are equal
Date: Thu, 6 Nov 2008 19:59:02 +0000 (UTC)
Organization: Harris Corporation Inc
Lines: 26
Message-ID: <gevia6$2hk$1@fred.mathworks.com>
Reply-To: "Colin " <colinzhe@gmail.com>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1226001542 2612 172.30.248.35 (6 Nov 2008 19:59:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 6 Nov 2008 19:59:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1567289
Xref: news.mathworks.com comp.soft-sys.matlab:499362


Hi all,

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.

A simple example could be:

M1 =
a
b
c
d

M2 =
b
c
d
a

My first thought was to use the 'circshift' function on one matrix and run it through a loop until the two matrices match exactly. Unfortunately, this takes a very long time.

Perhaps there is a faster/easier way to accomplish this?

Thanks for any tips and insight,
czhe