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

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

Sorting Vectors of structures: Whenever working with vector of structures, it is very common to sort based on a particular field within the structures. For illustration, recal

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

readlenwid function: function call: [length, width] = readlenwid; function header: function [l,w] = readlenwid In the function call, not any argument is passed; henc

Algorithm for expfn function: The algorithm for expfn function is as shown:  receives the value of x as the input argument.  Prints the value of exp(x).  assigns a

calcrectarea subfunction: function call: area = calcrectarea(len,wid); function header: function area = calcrectarea(len, wid)   In the function call, the two arg

Displaying expressions: The good-looking function will show such expressions by using exponents; for illustration, >> b = sym('x^2') b = x^2 >> pretty(b)

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

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