Reverse the vector elements.
Input x = [1,2,3,4,5,6,7,8,9]
Output y = [9,8,7,6,5,4,3,2,1]
Added some more tests.
Test set needs a column vector.
As far as timing goes ...
Elapsed time is 0.068947 seconds.
Elapsed time is 0.000026 seconds.
I did it!
Errors in the test suite.
This user (mohamed elbesealy) appears to have gamed the system, with fraudulent "likes" of this unremarkable solution submitted by 'sock-puppet' accounts. —DIV
Never knew about rot90. I did, y = x(length(x):-1:1) and the size was 19! Learnt something new..
That was easy
we had a similar problem in my class
how to make the code even shorter than this???
Multiply a column by a row
Compute a dot product of two vectors x and y
Find a subset that divides the vector into equal halves
Given a window, how many subsets of a vector sum positive
Solving Quadratic Equations (Version 1)
Arrange Vector in descending order
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office