In MATLAB, you create a vector by enclosing the elements in square brackets like so:
x = [1 2 3 4]
Commas are optional, so you can also type
x = [1, 2, 3, 4]
Create the vector
x = [1 2 3 4 5 6 7 8 9 10]
There's a faster way to do it using MATLAB's colon notation.
1 player likes this solution
1 player likes this solution
3 players like this solution
1 player likes this solution
2 players like this solution
1 player likes this solution
1 player likes this solution
1 player likes this solution
1 player likes this solution
1 player likes this solution
1 player likes this solution
1 player likes this solution
2 players like this solution
1 player likes this solution
20 players like this solution
2 players like this solution
Tags
Win cash prizes and have your live script featured on our website
Learn more
68 players like this problem
68 players like this problem