Very Simple Question that i couldn’t find easily on the web so i thought i would ask here:
You can make a 1D linear array like this:
1:10 = 1 2 3 4 5 6 7 8 9 10
1:2:10 = 1 3 5 7 9
How can you easily initialise a 2D array ie.
1 2 3 4
1 2 3 4
1 2 3 4
1 2 3 4
and also the same thing but for columns:
1 1 1 1
2 2 2 2
3 3 3 3
4 4 4 4
Should be a command to do it in one line.
Alternatively i have learned that you can use meshgrid:
Thanks for the help and upvotes.