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
Example to change the line width from the default: For illustration, to change the line width from the default of 0.5 to 1.5: >> set(hl,'LineWidth',1.5) As long as the

Logical scalar values: The MATLAB also has or and and operators which work element wise for the matrices: These operators will compare any of the two vectors or matric

Application: Menu driven Modular Program Numerous longer, more involved programs which have interaction with the user are menu-driven, that means that the program prints a men

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

Algorithm for the function explaine: The algorithm for the function explaine is as shown:  Print a description of e, the exp function, and how to find the approximate va

Finding a sting - function findstr: The function findstr receives two strings as input arguments. It finds all the occurrences of shorter string contained by the longer, and r

Print from the structure: To print from the structure, a disp function will show either the whole structure or a field. >> disp(package) item_no: 123 cost: 19.99

Creating the structure Variables: Creating a structure variable can be accomplished by simply storing the values in fields by using assignment statements, or by using the stru


Splits a string : The strtok function splits a string into pieces; it can be called in many ways. The function receives one string as an input argument. It appears for the fir