And checking size(r1), I get an answer of (200,) which is a 1D array. How would I be able to replicate MATLAB’s results to produce a 2x100 matrix? Any help would be great, thanks very much.
[a; b] is vcat, which combine the two arrays in the first dimension, [a b] is hcat which combine the two arrays in the second dimension. linspace returns a (vertical) vector so if you want to combine them in the other dimension you should use hcat so [linspace(r0[1],rf[1],N) linspace(r0[2],rf[2],N)] should work. (The result size will be (100, 2))
A side note: It is actually Matlab that is acting weird here. Matlab is supposed to be column-major, but still, functions like linspace and 1:10 return row vectors. Very odd, and frequently quite annoying.