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:
non-intersection of 2 matrices

Subject: non-intersection of 2 matrices

From: audley james

Date: 16 Oct, 2010 01:44:05

Message: 1 of 4

Hi,

I have 2 matrices


a =

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12


b =

     1
     3
     4
     6
     7
     8
     9
    10
    11


I'd like to return Non-intersecting values when both 'a' and 'b' are computed. So the values would be:

Non_intersect = [2
                         5
                         12]


Please suggest something.

Audley

Subject: non-intersection of 2 matrices

From: Roger Stafford

Date: 16 Oct, 2010 02:05:03

Message: 2 of 4

"audley james" <audleyer@gmail.com> wrote in message <i9b015$ran$1@fred.mathworks.com>...
> ......
> I'd like to return Non-intersecting values when both 'a' and 'b' are computed.
> ......
- - - - - - - - -
  Use setxor.

Roger Stafford

Subject: non-intersection of 2 matrices

From: Ross W

Date: 16 Oct, 2010 02:11:04

Message: 3 of 4

"audley james" <audleyer@gmail.com> wrote in message <i9b015$ran$1@fred.mathworks.com>...
> Hi,
>
> I have 2 matrices
>
>
> a =
>
> 1
> 2
> 3
> 4
> 5
> 6
> 7
> 8
> 9
> 10
> 11
> 12
>
>
> b =
>
> 1
> 3
> 4
> 6
> 7
> 8
> 9
> 10
> 11
>
>
> I'd like to return Non-intersecting values when both 'a' and 'b' are computed. So the values would be:
>
> Non_intersect = [2
> 5
> 12]
>
>
> Please suggest something.
>
> Audley

c = setdiff(A, B) returns the values in A that are not in B.

www.mathworks.com/help/techdoc/ref/setdiff.html

If that's not what you want, see setxor

Ross

Subject: non-intersection of 2 matrices

From: audley james

Date: 16 Oct, 2010 02:17:04

Message: 4 of 4

thanks a lot

audley

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