[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Save with variable argument
From: |
Quentin Spencer |
Subject: |
Re: Save with variable argument |
Date: |
Wed, 04 Jan 2006 09:04:45 -0600 |
User-agent: |
Mozilla Thunderbird 1.0.7-1.1.fc4 (X11/20050929) |
Reiner Suikat wrote:
Hi,
This may be a stupid question.
I want the following to work:
Fname = test.mat
save -binary Fname a b c ...
It appears that whatever I give as an argument to save is taken literally,
it simply does not substitute the filename.
I tried
save -binray (fname) ...
Well, it saved to (fname).
What's the trick?
There are two ways to do this that I can think of:
1) eval(sprintf('save -binary %s a b c',fname));
2) save('-binary',fname,'a','b','c');
The second one is probably better, because the eval function is slow and
should be avoided if there's another way of doing things.
-------------------------------------------------------------
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
-------------------------------------------------------------