Intersect function and setdiff function, MATLAB in Engineering

Intersect function and setdiff function:

The intersect function rather than returns all the values which can be found in both of the input argument vectors.

>> intersect(v1,v2)

ans =

    3   5

The setdiff function receives two vectors as input arguments, and returns a vector having all the values which are contained in the first vector argument but not in the second. And hence, the order of the two input arguments is very important.

>> setdiff(v1,v2)

ans =

2 4 6

>> setdiff(v2,v1)

ans =

    1   7

Posted Date: 10/22/2012 7:32:17 AM | Location : United States







Related Discussions:- Intersect function and setdiff function, Assignment Help, Ask Question on Intersect function and setdiff function, Get Answer, Expert's Help, Intersect function and setdiff function Discussions

Write discussion on Intersect function and setdiff function
Your posts are moderated
Related Questions
function numden: The function numden will return individually the numerator & denominator of a symbolic expression: >> sym(1/3 + 1/2) ans = 5/6 >> [n, d] =

str2num function - String: The function str2num does the opposite; it takes the string in which a number is stored and converts it to the type double: >> num = str2num('123.

Examine exponential function: The algorithm for the main script program is shown below:  Call a function eoption to show the menu and return the user's choice.  Loop

Forward substitution: The Forward substitution (done methodically by first getting a 0 in the a 21 place, and then a 31 , and lastly a 32 ): For the Gauss technique,

Replacing, Finding, and separating strings: There are numerous functions which find and replace the strings, or parts of strings, within the other strings and functions which

Illustration of Sorting strings: To sort on the rows rather than second dimension should be specified. >> sort(words,2) ans = Hello Hdowy Hi Gbdeo

Cross Product: The cross or outer product a × b of two vectors a and b is defined only whenever both a and b are the vectors in three-dimensional space, that means that they b

Reduced Row Echelon Form: The Gauss Jordan technique results in a diagonal form; for illustration, for a 3 × 3 system: The Reduced Row Echelon Forms take this one step

Scaling:   change a row by multiplying it by a non-zero scalar sri →  ri For illustration, for the matrix:

Function issorted - set operations: The function issorted will return 1 for logical true when the argument is sorted in ascending order (minimum to maximum), or 0 for false wh