It's actually just like Matlab except that Matlab doesn't have vectors or scalars at all – only nx1 and 1x1 matrices. It is different than what NumPy does, however.
On Wed, Jan 15, 2014 at 9:20 AM, Ping <[email protected]> wrote: > Thanks for your explain, so it seems different from matlab and numpy. > > > 在 2014年1月15日星期三UTC+8下午7时06分50秒,Billou Bielour写道: > >> Julia has N-vectors in addition to matrices, for performance reasons, as >> far as I know. N-vectors have only one dimension while matrices have two >> (even Nx1 and 1xN ones). >> >> In most linear algebra operation N-vectors behave like Nx1 matrices, this >> means you can multiply a NxN matrix with N-vector. In addition when you >> extract a column from a matrix ( A[:,1] ) it gives you a N-vector and not a >> Nx1 matrix, while getting a row gives you a 1xN matrix. >> >> Transposition automatically convert your N-vector to a matrix, this leads >> to the weird inequality a != a'' because a and a'' are not of the same type. >> >> All of this seems a bit weird, and I don't completely understand why it >> works like that, but there's some reasons, either performances or design, >> for why it's like that. It's not a big deal in practice though, once you >> understand how it behave. >> >> >> >
