Problem 42651. Vector creation
Create a vector using square brackets going from 1 to the given value x in steps on 1.
Hint: use increment.
Solution Stats
Problem Comments
-
4 Comments
Show
1 older comment
Javid Moraveji
on 4 Jun 2022
Is this just about natural number? Otherwise the tests should include negative integer numbers.
Bertopedro
on 10 Nov 2023
why should use square brackets when colon just work
Krisha
on 9 Feb 2025
Easy to solve
Solution Comments
Show commentsProblem Recent Solvers9488
Suggested Problems
-
Generate a vector like 1,2,2,3,3,3,4,4,4,4
11964 Solvers
-
Sum the numbers on the main diagonal
590 Solvers
-
Convert a Cell Array into an Array
1931 Solvers
-
Find out sum of all elements of given Matrix
510 Solvers
-
Find the sides of an isosceles triangle when given its area and height from its base to apex
1975 Solvers
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!