How To Create An Array In Matlab

To create an array using Matlab we need to use the square bracket symbol “[]”, and enclosed inside we store our values each separated by either spaces or commas.

So for example, I wanted to create an array variable name a and inside I want to store the data 1 2 3 4.

It would look something like this below:

a = [1, 2, 3, 4]