I have to make an algorithm that receives five number and print them in ascending order, anyone knows how to do it?
Afficher commentaires plus anciens
clear variables;
close all;
clc;
for i:5
x(i) = input('Write the number:');
end
if
Réponses (1)
Image Analyst
le 10 Juin 2015
0 votes
Why do you have to do this? Homework? I'm going to assume so, and for that reason I'm just going to give you the hint to look up sort() and fprintf() in the help. It should be really trivial now that you know to use those functions.
1 commentaire
N/A
le 10 Juin 2015
Catégories
En savoir plus sur Loops and Conditional Statements dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!