Add a row to a matrix in Julia? -


how can add row matrix in julia?

for example,

mat = [1 2 3; 3 4 2] 

and want add row x = [4 2 1] @ end. tried:

push!(mat, x) 

but gives error.

for concatenation of matrix such way can so:

mat = [mat;x] 

or use function vertical concatenation:

vcat(mat,x) 

read more these operations in documentation.


Comments

Popular posts from this blog

php - Passing multiple values in a url using checkbox -

compilation - PHP install fails on Ubuntu 14 (make: *** [sapi/cli/php] Error 1) PHP 5.6.20 -

sql - Postgresql tables exists, but getting "relation does not exist" when querying -