help-octave
[Top][All Lists]
Advanced

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

Re: sprintf to make filenames


From: Jonathan C. Webster
Subject: Re: sprintf to make filenames
Date: Mon, 11 Mar 2002 11:59:39 -0500

Mike Miller wrote:

> Hello all--
>
> I want to be able to use the usual save command of this form:
>
> save -ascii file_0001.dat matrixdata
>
> but I'd like for the filename to be determined by a variable in this sort
> of way:
>
>
>

That does work.  Here is an example:  "runNo" and "data_to_save"  are
defined  by your code.



fnam_t= sprintf("%s.type",runNo);

str = sprintf("save %s  data_to_save",fnam_t);

eval(str);

Hope that helps.

Jonathan



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

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