Got Questions? Get Answers.
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:
similarity between two matrix with different size

Subject: similarity between two matrix with different size

From: edward kabanyas

Date: 16 Apr, 2012 05:28:06

Message: 1 of 3

Dear all,

I want to check the similarity of two matrices having different size (row). I want to know how much the percentage of value in all column of A is similar with all column of B, vice versa. I can do it by looping procedure, however, for big file it takes very long time. For example,

A = [1 1; 1 3; 2 6; 4 4];
B = [1 1; 4 4; 1 6];

We can see clearly about 2/4 or 50% of column A is similar with B; or 2/3 (66.67%) of coulumn B similar with those of A. Probably you have an efficient way to calculate such percentage without using looping ? Thank you..

Edward

Subject: similarity between two matrix with different size

From: Bruno Luong

Date: 16 Apr, 2012 06:15:07

Message: 2 of 3

"edward kabanyas" <djuky_hmi@yahoo.com> wrote in message <jmgal6$a77$1@newscl01ah.mathworks.com>...
> Dear all,
>
> I want to check the similarity of two matrices having different size (row). I want to know how much the percentage of value in all column of A is similar with all column of B, vice versa. I can do it by looping procedure, however, for big file it takes very long time. For example,
>
> A = [1 1; 1 3; 2 6; 4 4];
> B = [1 1; 4 4; 1 6];
>
> We can see clearly about 2/4 or 50% of column A is similar with B; or 2/3 (66.67%) of coulumn B similar with those of A. Probably you have an efficient way to calculate such percentage without using looping ? Thank you..
>

Check out ismember(), intersect() with 'rows' option.

Bruno

Subject: similarity between two matrix with different size

From: edward kabanyas

Date: 16 Apr, 2012 06:46:08

Message: 3 of 3

Bruno, thank you, this is what I am looking for, thanks again..

>Check out ismember(), intersect() with 'rows' option.


"Bruno Luong" <b.luong@fogale.findmycountry> wrote in message <jmgddb$kd6$1@newscl01ah.mathworks.com>...
> "edward kabanyas" <djuky_hmi@yahoo.com> wrote in message <jmgal6$a77$1@newscl01ah.mathworks.com>...
> > Dear all,
> >
> > I want to check the similarity of two matrices having different size (row). I want to know how much the percentage of value in all column of A is similar with all column of B, vice versa. I can do it by looping procedure, however, for big file it takes very long time. For example,
> >
> > A = [1 1; 1 3; 2 6; 4 4];
> > B = [1 1; 4 4; 1 6];
> >
> > We can see clearly about 2/4 or 50% of column A is similar with B; or 2/3 (66.67%) of coulumn B similar with those of A. Probably you have an efficient way to calculate such percentage without using looping ? Thank you..
> >
>
> Check out ismember(), intersect() with 'rows' option.
>
> Bruno

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