Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
a chain process for many matrices

Subject: a chain process for many matrices

From: edward kabanyas

Date: 17 Apr, 2012 05:54:13

Message: 1 of 1

Hi all,

I need some advice again. I am comparing many matrices to get continuously data within them. For simple, the following example is close to my case, assume we have matrices

A = [1 2 3 4];
B = [1 3 5 6];
C = [1 10 3 4 11];
D = [1 3 5 4];
E = [4 5 7 1 12 13];
F = [1 7 5 4];
and so on

From the above example, the similar consecutive data (contionously) within the matrices are:

Similar(1) = [1 1 1 1 1 1] from [A(1) B(1) C(1) D(1) E(4) F(1)];
Similar (2) = [3 3 3 3] from [A(3) B(2) C(3) D(2)];
Similar (3) = [4 4 4 4] from [C(4) D(4) E(1) F(4)];
Similar (4) = [5 5 5]; from [D(3) E(2) F(3)];
Similar (5) = [7 7]; from [E(3) F(2)];

Comparing A and B can be easily done by using looping procedure, the difficult thing is after getting preliminary similar-data, for example, Similar1 =[1 1] and Similar2 =[3 3], then we still need to compare B(1) and B(3) as well other data [B(3) B(4)] with the data in C. If B(1) and B(3) is the same as those in C, we need to include the value to Similar1 and Similar2. Moreover, if B(3) and B(4) match with those in C we need to create a new array Similar3, and so on...Probably you have an experience to do this kind of analysis. Thanks for sharing, I really appreciate it.

Best regards,
Edward

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us