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
经过的时间为0.000026秒。
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
-
1 Comment
好问题
-
1 Comment
good one
-
1 Comment
//www.tianjin-qmedu.com/help/matlab/ref/flip.html
-
1 Comment
nice
-
1 Comment
easy
-
1 Comment
easy
-
1 Comment
我看到我将不得不记住很多这种语法,以使我的生活更轻松。
-
1 Comment
This link can help:
https://in.mathworks.com/help/matlab/ref/fliplr.html
-
1 Comment
I did it!
(^^)v
-
1 Comment
gj
-
1 Comment
Errors in the test suite.
-
1 Comment
This user (mohamed elbesealy) appears to have gamed the system, with fraudulent "likes" of this unremarkable solution submitted by 'sock-puppet' accounts. —DIV
-
1 Comment
Never knew about rot90. I did, y = x(length(x):-1:1) and the size was 19! Learnt something new..
-
1 Comment
那很简单
-
1 Comment
we had a similar problem in my class
-
1 Comment
easy one
-
1 Comment
how to make the code even shorter than this???
-
1 Comment
helpfull!
-
1 Comment
Test set needs a column vector.
Problem Recent Solvers9305
Suggested Problems
2605求解器
547 Solvers
Given a window, how many subsets of a vector sum positive
818 Solvers
552 Solvers
514 Solvers
来自作者的更多1
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
开始狩猎!