|
From: | Cassia M. Batista Nobre |
Subject: | Re: Saving data |
Date: | Wed, 30 Aug 2006 21:20:16 -0300 |
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
[Prev in Thread] | Current Thread | [Next in Thread] |