Create a row vector containing integers from 1 to 10

How to Create a row vector containing integers from 1 to 10

Answers (2)

A = 1:10 ; % double
I = uint8(1:10) % unsigned integers
I = 1×10
1 2 3 4 5 6 7 8 9 10
I believe this should be one of the very first things you'll learn when learning MATLAB. Spend a couple of hours in the link below, and you can avoid asking lots and lots of questions like that because you'll come up to speed very quickly after those two hours:

This question is closed.

Asked:

on 7 Feb 2022

Closed:

on 7 Feb 2022

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!