What's the meaning of the array syntax , ;

No, I don’t want to suggest any really big changes, not now.

It would make more sense to me if ; produced an nx1 matrix instead of a vector. So the simple rule becomes: commas do vectors, semicolons and spaces concatenate and produce matrices.

That would entail the following changes.

  • vcat produces nx1 matrices.
  • hcat produces 1xn matrices
  • hvcat produces mxn matrices
  • a new function cat takes vectors and returns a vector

The idea is that hcat and vcat, with their direction explicitly included, only make sense in a 2D context, and it helps separate vectors and 1xn/nx1 matrices more meaningfully. The convenient [v;w] becomes cat(v,w) or cat([v,w]).

To me that’s cleaner, but maybe other beginners would be confused by distinguishing vectors/1xn,nx1 matrices this way. Would be interested to get other people’s ideas.