Illustration of set operations, MATLAB in Engineering

Illustration of Set operations:

For illustration, given the vectors as shown below:

>> v1 = 2:6

v1 =

2  3  4  5  6

>> v2 = 1:2:7

v2 =

1  3  5  7

The union function returns a vector which contains all the values from the two input argument vectors, without replicating any.

>> union(v1,v2)

ans =

1 2 3 4 5 6 7

 

Posted Date: 10/22/2012 7:31:30 AM | Location : United States







Related Discussions:- Illustration of set operations, Assignment Help, Ask Question on Illustration of set operations, Get Answer, Expert's Help, Illustration of set operations Discussions

Write discussion on Illustration of set operations
Your posts are moderated
Related Questions
Creating a cell array: The other method of creating a cell array is easy to assign values to particular array elements and build it up element by element. Though, as explained

Converting between the String and Number types: The MATLAB has many functions which convert numbers to strings in which each character element is a separate digit, and vice ve

Use of While loop: Here is an illustration of calling the function, passing 5000 for the value of the input argument high. >> factgthigh(5000) ans = 5040 The itera

Algorithm for subfunction: The algorithm for subfunction askforn is as shown:  Prompt the user for the positive integer n.  Loop to print an error message and reprom

Illustration sorting vectors of structures: This function sorts the structures depend only on the price field. A more common function is shown next, that receives a string whi

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

Reading from a File in a While Loop: Though in most languages the combination of a loop and an if statement would be essential to determine whether or not the elements in a ve

Calling of Function polyval: The curve does not appear very smooth on this plot, but that is as there are only five points in the x vector. To estimate the temperature

Indexing into Vectors of structures: Frequently, when the data structure is a vector of structures, it is essential to iterate through the vector in order by various fields. F

Preallocating a Vector: There are necessarily two programming techniques that can be used to simulate the cumsum function. One technique is to begin with an empty vector and c