I have to make an algorithm that receives five number and print them in ascending order, anyone knows how to do it?
Show older comments
clear variables;
close all;
clc;
for i:5
x(i) = input('Write the number:');
end
if
Answers (1)
Image Analyst
on 10 Jun 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.
Categories
Find more on Loops and Conditional Statements in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!