In MATLAB, the following syntax can be used to create 1-d matrix a and 2-d matrix b:
a = [2,3]
b = [2,3;4,5]
In Julia, constructing the 1-d array a using the same syntax works. However, constructing the 2-d array b using the same syntax fails.
Defining b as follows works:
b = cat(2,[2,4],[3,5])
Is there a syntactical shortcut for explicitly defining 2-d arrays in Julia? If so, what is it?
You can also say [1 2; 3 4], which gives the same result as in Matlab.