The bracket operator could be used to access a section of data from a vector or a matrix. If a is a vector, then a(1:3), a(1:3,:), or a(1:3,:, : ) is also a vector in Matlab, because we couldn’t access something that is empty. Similar operations for a matrix. Why we do this is another question. The operation itself is valid without any warning or error. This is well documented in Matlab manual.
In Julia, I looked at the user manual and also searched online for the square bracket operator. The information I got is very limited. Clearly the square bracket operator has the function of accessing, but also extension of array dimensions if additional ',: ’ are placed inside the square bracket.
This is not a problem. However, a detailed user manual will be very helpful, from a user’s perspective.
Similar, if the vector and Nx1 matrix definitions could be detailed in the user manual, especially in the Linear Algebra section, that will be very helpful for beginners.
After all, a vector is normally considered as a Nx1 matrix in Linear Algebra. We could watch the MIT online open course, Linear Algebra, presented by well known Professor of mathematics Gilbert Strang (2. Elimination with Matrices. - YouTube). Prof. Strang stated that ‘We could even regard a column vector as a matrix with only one column (so n=1)’, and ‘All this is only common sense’ etc in the second chapter of his book ‘Introduction to Linear Algebra’.
If Julia defines a ‘flat’ vector for computational performance or any other reasons, that is perfectly ok. However, a well written user manual or document will be very helpful to avoid unnecessary user misunderstanding for Julia beginners. I don’t know if it is too much though, as Julia is clearly at the very early stage.
At the moment, I am still not clear where should we define a vector using zeros(n), or a matrix using zeros(n,1) for different applications.