This solution is outdated. To rescore this solution, sign in.
-
3 Comments
Henry Lu
on 29 Mar 2017
What's wrong? I tried it on the matlab desktop,it's okay.
Syanki Kumar Burnwal
on 25 Apr 2017
same problem here
UnCroissant
on 21 May 2017
sort(x) will always return a increasing vector.
So all(diff(sort(x)))>0 is always true, if x has just unique elements.
try all((diff(x))>0)
Suggested Problems
-
13585 Solvers
-
22340 Solvers
-
Create an n-by-n null matrix and fill with ones certain positions
631 Solvers
-
7371 Solvers
-
990 Solvers
More from this Author96
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!