help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: saving data without the header


From: Andy Buckle
Subject: Re: saving data without the header
Date: Mon, 23 Jan 2012 09:31:03 +0000

On 23 January 2012 09:08, Jean Dupont <address@hidden> wrote:
> When saving data produced with octave like this:
> save('mydata.dat','y');
>
> the file mydata.dat always starts with a header like this:
>
> # Created by Octave 3.2.4, Fri Jan 20 20:08:08 2012 CET <address@hidden>
> # name: y
> # type: matrix
> # rows: 69
> # columns: 5
>
> Is there a possibility to suppress this header?
>
> thanks
> Jean

There may be a better way than this.

a=floor(rand(2,3)*10)
save a.dat a ;
fid=fopen("noheader.txt",'w');
f = repmat(" %i",1,columns(a)); % you may want a different format %.4f maybe
fprintf(fid, [f "\r\n"],a'); % use the right EOL for your system
fclose(fid);

Compare a.dat and noheader.txt. They are the same, apart from the header.


-- 
/* andy buckle */


reply via email to

[Prev in Thread] Current Thread [Next in Thread]