Problem 233. Reverse the vector
Solution Stats
Problem Comments
-
8 Comments
Added some more tests.
Test set needs a column vector.
As far as timing goes ...
x=rand(100,1);
tic;y=flipud(x);toc
Elapsed time is 0.068947 seconds.
tic;y=x(end:-1:1);toc
Elapsed time is 0.000026 seconds.
innovative
thanks Kristin but I got it on my own
I'm not understanding why sort(x, 'descend') is not correct. On matlab works.
GOOD
function y = rev(x)
y=sort(x,'descend');
end
i'm doing like this but i have 1 assertion error ? what's wrong?
Solution Comments
Show commentsProblem Recent Solvers11737
Suggested Problems
-
Find the numeric mean of the prime numbers in a matrix.
8392 Solvers
-
Project Euler: Problem 7, Nth prime
1301 Solvers
-
1152 Solvers
-
Matrix indexing with two vectors of indices
694 Solvers
-
Find x rows where the sum of the numbers is the maximum
375 Solvers
More from this Author1
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!