on-internet
← Community

Convert vector in matrix in Julia

Stack Overflow ·

To transform a vector into a one-dimensional matrix just run in Julia: a = copy(permutedims([1,2,3])) To transform the matrix "a" into a vector just use: b = copy(vec(a)) If you have a matrix "[1 2 3; 4 5 6]" to transform it into a vector, just: c = vec([1 2 3; 4 5 6]) Now how to make the vector have the form of the 2x3 matrix like: 2×3 Matrix{Int64}: 1 2 3 4 5 6

Comments

Sign in or sign up to comment and upvote.

No comments yet.