help-octave
[Top][All Lists]
Advanced

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

Re: variable for directory in cd


From: Chengqi Zhang
Subject: Re: variable for directory in cd
Date: Wed, 10 Mar 2010 08:15:45 +0800
User-agent: Opera Mail/10.10 (Win32)

On Wed, 10 Mar 2010 05:22:01 +0800, <address@hidden> wrote:

I'm trying to use the UNIX command "cd" to jump in and out of directories
programmatically in Octave.  How do I use my variable in the cd command?
trying...
dirs = ls -d */
for j = 1:length(dirs(:,1)),
     cd dirs(j,:)   % line I'm having trouble with
     % do stuff
     cd ..
end
I'm running Octave 3.0.1 under Ubuntu
thanks!

cd dirs(j,:)
is equivalent to
cd('dirs(j,:)')

use
cd(dirs(j,:))
instead

--
Best Regards!
---------------------------
Sincerely,                      Chengqi Zhang
China Center for Economic Research
Mail: address@hidden
Personal Website: http://macro2.cn


reply via email to

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