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 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

Illustration of Subfunctions: This is an illustration of running this program: >> rectarea Please enter the length: 6 Please enter the width: 3 For a rectan

Finding a sting - function strfind: The function strfind does necessarily similar thing, except that the order of the arguments does make dissimilarity. The common form is str

Function fieldnames - structure functions: The function fieldnames will return the names of the fields which are contained in the structure variable. >> pack_fields = fiel

Sort algorithm for Sorting vectors of structures: Note that only the price field is compared in the sort algorithm, but the whole structure is replaced. That is therefore each

1. Write a MATLAB function (upperTriangle) using the functions you previously created to convert a matrix to upper triangular form. Start with row 1, column1. Find the row that has

Sound Files: The sound signal is an illustration of a continuous signal which is sampled to result in a discrete signal. In this situation, sound waves traveling through the a

Structures: The Structures are data structures which group together values which are logically related in what are known as the fields of structure. The benefit of structures

Algorithm for the function e: The algorithm for the function eoption is as shown: Use the menu function to show the 4 choices. Error-check (an error would take place

Gauss Elimination: The Gauss elimination technique consists of:    Generating the augmented matrix [A b]    Applying EROs to augmented matrix to obtain an upper trian