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