How to import to a Matrix data defined in the code script

For a DataFrame I can do:


coeff = CSV.read(IOBuffer("""
-400     -100     1     0     0     0
0     -300     0     1     0     0
1     0     0     0     -1     0
0     1     0     0     0     -1
0.8     0.4     0     0     0     0
0.5     1     0     0     0     0
200     100     0     0     0     0
0     0     0     0     800     1200
"""), DataFrame, delim=" ", ignorerepeated=true, header=false)

(and then I could use coeff2 = Matrix(coeff))

But is there a more direct way? CSV with Matrix as sink doesn’t work and coeff = readdlm(IOBuffer("""... doesn’t have the ignorerepeated option…

Any particular reason why you can’t use the appropriate syntax for this, i.e. something like

coeff = [1 2 3;
         4 5 6;
         7 8 9]

?

yes you are right, at the end is just typing some semicolons…