next up previous contents index
Next: 4.2 Help Up: 4.1 The Environment and Previous: 4.1.2 Startup Commands by

      
4.1.3 Input and Output

Although the commands save and load are convenient, one has much more control over the transfer of data between files and Scilab by using the commands read  and write . These two commands work similarly to the read and write commands found in Fortran. The syntax of these two commands is as follows.

 
--> x=[1 2 %pi;%e 3 4]
 x         =
 
!   1.           2.    3.1415927 !
!   2.7182818    3.    4.        !
 
--> write('x.dat',x)
 
--> clear x
 
--> xnew=read('x.dat',2,3)
 xnew      =
 
!   1.           2.    3.1415927 !
!   2.7182818    3.    4.        !
Notice that read specifies the number of rows and columns of the matrix x. Complicated formats can be specified.


next up previous contents index
Next: 4.2 Help Up: 4.1 The Environment and Previous: 4.1.2 Startup Commands by
Scilab Group