Crea una función que ordene vectores de tal manera que los primeros números sean negativos ordenados de menor a mayor. Y después vayan los números positivos ordenados de mayor a menor.
Por ejemplo:
y = [-1 6 15 -7 31 2 -4 -5];
y_correct = [-7 -5 -4 -1 31 15 6 2];
PD: Considerad el cero como número positivo.
Solution Stats
Problem Comments
Solution Comments
Show comments
Loading...
Problem Recent Solvers45
Suggested Problems
-
Swap the first and last columns
23040 Solvers
-
18253 Solvers
-
731 Solvers
-
500 Solvers
-
Find sum of negative elements in row.
122 Solvers
More from this Author3
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!