help-octave
[Top][All Lists]
Advanced

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

Re: Saving data


From: David Bateman
Subject: Re: Saving data
Date: Thu, 31 Aug 2006 01:24:58 +0200
User-agent: Thunderbird 1.5.0.5 (X11/20060817)

Cassia M. Batista Nobre wrote:
> Hi,
> 
> I'm having the following issue(testing purpose):
> 
> ---
> x = [1 2 3 4 5];
> 
> f_txt = "text_file";
> save -text f_txt x;
> f_mat = "matlab_file";
> save -mat-binary f_mat x;
> ---
> 
> I am getting two files as output: 'f_txt' and 'f_mat' instead of their
> values ('text_file' and 'matlab_file')
> I've tried with save(...) and it did not work too.
> 
> Is there any way of saving data with file name not static,
> I mean in my example, is it possible to get 'text_file' and
> 'matlab_file' as output?
> 
> Thanks.
> Cassia.
> 

I believe you want the functional form of the save command, so the above
would read

f_txt="text_file";
save("-text",f_txt,"x");
f_mat="matlab_file";
save("-mat-binary",f_mat,"x");

otherwise the variables f_txt and f_mat are treated as filenames as you
found out



reply via email to

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