[scilab-Users] Write complex matrix to a file

Serge Steer Serge.Steer at inria.fr
Fri Oct 14 09:51:50 CEST 2011


Le 13/10/2011 20:47, joschi a écrit :
> Hi Group,
>
> i have timedata in a fiel. So i input the timedata-file and do a fft. Now i
> have complex data.
> How do i write them again in a file. I do not found any command that do
> that.
>
It depends what you want to do with your file

If you want to read it later into Scilab you can simply use the save and 
load functions (with perform binary write and read, without loss of accuracy

If you want to read it with an other software you can use formatted 
write. for example if y is the result of your fft

//C like write
y=y(:) //make y a column vector
u=mopen("myfile","wb")
mfprintf(u,"%e %e\n",real(y), imag(y))
mclose(u)


//Fortran like write
write("myfile",[real(y), imag(y)],"(E16.9,1x,E16.9)")


Both will create a file containing the data formatted in two columns in 
each row the data are separated with a space

Serge Steer
INRIA
> Thanks for your help.
>
> --
> View this message in context: http://mailinglists.scilab.org/Write-complex-matrix-to-a-file-tp3419439p3419439.html
> Sent from the Scilab users - Mailing Lists Archives mailing list archive at Nabble.com.
>




More information about the users mailing list