Counting by One, placing it in a string
Show older comments
So I am trying to make a program that a user can input a starting variable (n0), and how many numbers in want to view (n), and it will display that in this format.
n0=5, n=10
5,6,7,8,9,10,11,12,13,14
I REALLY want to use a for loop, but im open to suggestions. Thanks!
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
This is what i have so far, and its not even close :
%%User input
N0=input('What should n0 be? ');
N=input('What should n be? ');
a(1)=N0;
%%For loop
for ix=N0:1:N
x(is)=(ix)
end
Making it into a string is going to be the second hard part.
Accepted Answer
More Answers (0)
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!