Function issorted - set operations, MATLAB in Engineering

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 when not.

>> v3 = [1:5 3:6]

v3 =

1 2 3 4 5 3 4 5 6

>> issorted(v3)

ans =

   0

>> issorted(v1)

ans =

   1

>> vec = 4:-1:1

vec =

4 3 2 1

>> issorted(vec)

ans =

   0

Posted Date: 10/22/2012 7:35:39 AM | Location : United States







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

Write discussion on Function issorted - set operations
Your posts are moderated
Related Questions
Binary Search: The binary search supposes that the vector has been sorted first. The algorithm is just similar to the way it works whenever looking for a name in a phone direc


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

Initializing the data structure - Function: Function is shown as:   >> printcylvols(cyls) Cylinder x has a volume of 169.6 Cylinder a has a volume of 100.5

Passing Structures to Functions: The whole structure can be passed to a function, or separate fields can be passed. For illustration, here are the two distinct versions of a f

Illustration of Preallocating a Vector: Illustration of calling the function: >> myveccumsum([5 9 4]) ans =     5  14  18 At the first time in the loop, outvec wil

Storing Strings in Cell Arrays: The one good application of a cell array is to store strings of various lengths. As cell arrays can store various types of values in the elemen

Illustration of Passing arguments to functions: Here is an illustration of calling this function: >> printrand() The random # is 0.94 As nothing is passed to

Function cellplot - Cell array: The function cellplot place a graphical display of the cell array in a figure Window; though, it is a high-level view and fundamentally just di

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