help-octave
[Top][All Lists]
Advanced

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

Re: Saving data


From: Cassia M. Batista Nobre
Subject: Re: Saving data
Date: Wed, 30 Aug 2006 21:20:16 -0300

Thanks David, it works.

Regards,
Cassia.

On 8/30/06, David Bateman <address@hidden > wrote:
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]