From help-octave-request at bevo dot che dot wisc dot edu Wed Dec 8 21:30:30 1999 Subject: "save" and "load" commands From: "John W. Eaton" To: Michelle L Povinelli Cc: help-octave at bevo dot che dot wisc dot edu Date: Wed, 8 Dec 1999 21:30:59 -0600 (CST) On 8-Dec-1999, Michelle L Povinelli wrote: | I would like to successively load data from, for example, | files named "myfile1," "myfile2," "myfile3,"... etc. | If I create a string variable holding the file name, | and try to load it with | | for ii=1:200 | filename=["myfile" num2str(ii)] | load filename | end | | octave tries to load from the file "filename," not "file1," etc. | How do I force evaluation of the string variable in the load (or save) | commands? Write either load (filename); or eval (sprintf ("load %s", filename)); jwe ----------------------------------------------------------------------- Octave is freely available under the terms of the GNU GPL. Octave's home on the web: http://www.che.wisc.edu/octave/octave.html How to fund new projects: http://www.che.wisc.edu/octave/funding.html Subscription information: http://www.che.wisc.edu/octave/archive.html -----------------------------------------------------------------------