Contents

# Input/Output

Matrices and vectors can be saved into comma-separated values (CSV) files. Then one can read these objects back. Let us write a matrix into a "test.csv" file:

M=[1:3 ; 4:6 ; 7:9]
printf('%f\n',M)
csvwrite("test.csv",M)

You can read it back as:

M=csvread("test.csv")
printf('Read matrix=%f\n',M)

Similarly, you can write and read vectors:

A=[1:10]
printf('%f\n',A)
csvwrite("test2.csv",A)
printf('Read vector=%f\n',A)