help-octave
[Top][All Lists]
Advanced

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

Re: Saving data


From: Quentin Spencer
Subject: Re: Saving data
Date: Thu, 31 Aug 2006 00:06:00 -0500
User-agent: Thunderbird 1.5.0.5 (Windows/20060719)

David Bateman 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

This seems to be a bit of a FAQ lately. Maybe it should go in the documentation somewhere.

Quentin


reply via email to

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