Problem 247. Arrange Vector in descending order
Solution Stats
Problem Comments

12 Comments
it is a good problem,but I cann't solve it
Only one verification test!? and this test already has the vector sorted.
li look up the options of the sort command
Needs (much) more tests in the Test Suite!! It would also be a good idea to include a randomly generated vector in the tests; for this random input, testing of the correct function output should be hardcoded as: assert(y(1)>=y(2)); assert(y(2)>=y(3)); ... ; assert(y(end1)>=y(end)); [It's not the most efficient check, but anything else will risk giving away clues on possible solution codes.]
i comment for the challenge
nice
comment = badge
I do not understand what is wrong with the solution?
I solved question with my algorithm
function y=desSort(x)
x=input(' give me input to obtain descending order of input')
y = zeros(size(x));
indis=0;
for j=1:length(x)
maksimum=x(j);
for i=1:length(x)
if x(i)>maksimum
maksimum=x(i);
a=i;
end
end
x(a)= 0
y(j)=maksimum
end
end
sort
tried using the sort function in a descending order would not work
good
sort with direction
Solution Comments

1 Comment
Nice

1 Comment
Sort and its arguments

1 Comment
good exercise

1 Comment
medium difficulty

1 Comment
Implemented Selection sort, not hard.

1 Comment
easy

1 Comment
This problem was fun!

2 Comments
good problem
good problem

1 Comment
Pretty simple!

2 Comments
Very nice problem (:
Cool

1 Comment
great

1 Comment
good review of skills

1 Comment
Cool Problem!

1 Comment
wow

1 Comment
This user appears to have gamed the system, with fraudulent "likes" of this unremarkable solution submitted by 'sockpuppet' accounts. —DIV

1 Comment
This user (ALBERT ALEXANDER STONIER) appears to have gamed the system, with fraudulent "likes" of this unremarkable solution submitted by 'sockpuppet' accounts. —DIV

2 Comments
Every time again, it's pretty amazing, to see what powerfull little functions are implemented in Matlab!
You can do this with one function call. See the mode flag in sort().

1 Comment
:p
Problem Recent Solvers7983
Suggested Problems

Sort a list of complex numbers based on far they are from the origin.
5081 Solvers

Find the peak 3n+1 sequence value
1776 Solvers

1174 Solvers

Create a two dimensional zero matrix
442 Solvers

Solve a System of Linear Equations
8449 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!