Problem 2. Make the vector [1 2 3 4 5 6 7 8 9 10]
This is very easy thing
Easy problem! Great!
Great beginner problem!
the solution is well used by day to day users in matlab
It is so easy.Don't you think?
what is difference between 123456 and 1 2 3 4 5 6 vectors?
Yeah, I personally like the colon operator for creating vectors!
@Muhammad Tanveer: if you take 123456 (without commas, semicolons or spaces), it is one (huge) number.
You can create a vector both by enclosing the elements in square brackets like v=[1 2 3 4 5] or using commas, like v=[1,2,3,4,5]. They mean the very same: a vector (matrix) of 1 row and 5 columns. It is up to you.
If you used a semicolon (;), then v=[1;2;3;4;5] means something else: a vector of 5 rows and one single column.
Great idea to learn colon notation! Thanks!
Why did I copy the code to the matlab editor and run it but the command line window says I didn't define a function or variable?
i need more points
link is very helpful
Solution CommentsShow comments
Problem Recent Solvers44817
Find the peak 3n+1 sequence value
Program an exclusive OR operation with logical operators
Project Euler: Problem 6, Natural numbers, squares and sums.
Find the Oldest Person in a Room
More from this Author96
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!