12.07.2015 Views

GNU Octave - Local Sector 7 web page

GNU Octave - Local Sector 7 web page

GNU Octave - Local Sector 7 web page

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 27: Sets 22727 Sets<strong>Octave</strong> has a limited set of functions for managing sets of data, where a set is defined asa collection unique elements.create set (x)Function FileReturn a row vector containing the unique values in x, sorted in ascending order. Forexample,create_set ([ 1, 2; 3, 4; 4, 2 ])⇒ [ 1, 2, 3, 4 ]union (x, y)Function FileReturn the set of elements that are in either of the sets x and y. For example,union ([ 1, 2, 4 ], [ 2, 3, 5 ])⇒ [ 1, 2, 3, 4, 5 ]intersection (x, y)Return the set of elements that are in both sets x and y. For example,intersection ([ 1, 2, 3 ], [ 2, 3, 5 ])⇒ [ 2, 3 ]Function Filecomplement (x, y)Return the elements of set y that are not in set x. For example,complement ([ 1, 2, 3 ], [ 2, 3, 5 ])⇒ 5Function File

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!