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 hard-coded as: assert(y(1)>=y(2)); assert(y(2)>=y(3)); ... ; assert(y(end-1)>=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
hey
Very nice problem (:
Cool
great
good review of skills
Cool Problem!
wow
This user appears to have gamed the system, with fraudulent "likes" of this unremarkable solution submitted by 'sock-puppet' accounts. —DIV
This user (ALBERT ALEXANDER STONIER) appears to have gamed the system, with fraudulent "likes" of this unremarkable solution submitted by 'sock-puppet' accounts. —DIV
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().
:p
Find all elements less than 0 or greater than 10 and replace them with NaN
13772 Solvers
940 Solvers
Given an unsigned integer x, find the largest y by rearranging the bits in x
949 Solvers
Back to basics 22 - Rotate a matrix
796 Solvers
Right Triangle Side Lengths (Inspired by Project Euler Problem 39)
834 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!