One element vector cannot be used to multiply another vector/matrix

Not sure if that is clear, but if all where actually vectors all that works, i. e:

julia> rand(3)' * rand(3) # is a dot product, returns a scalar
0.3042989054310262

all the confusion boils down to the difference between matrix with one column and a vector, difference that does not exist in Matlab.

That is, in Julia rand(3,1) is not the same as rand(3), and unless you get that 1-column matrix from another source, that is not the Julian way to define vectors. You can also convert that one-column matrix to a vector, using vec(rand(3,1)).

5 Likes