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:
row intersect question

Subject: row intersect question

From: audley james

Date: 16 Jan, 2011 23:48:04

Message: 1 of 2

hello all,

I have two vectors 'r' and 's' of different column sizes.


r = [ 10 20 ;
        99 44 ]


s = [ 30 40 20 10;
        44 99 56 13]

Rows of 'r' , are inside 's' . How can I intersect 'r' and 's' get the answer :

ans =
          [10 20 ;
           99 44]

thanks
audley

Subject: row intersect question

From: ImageAnalyst

Date: 17 Jan, 2011 02:34:23

Message: 2 of 2

audley:
Strange answer that you want (it's just r again). But anyway try
this:

r = [ 10 20 ;
      99 44 ]
s = [ 30 40 20 10;
      44 99 56 13]
% Display what he wants
r

In the command window,you'll see this:
r =
    10 20
    99 44
s =
    30 40 20 10
    44 99 56 13
r =
    10 20
    99 44

Note: "r" is your "ans"

Tags for this Thread

No tags are associated with 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