Path: news.mathworks.com!not-for-mail
From: "carlos lopez" <clv2clv_00000000_@adinet.com.uy>
Newsgroups: comp.soft-sys.matlab
Subject: Re: How to execute all the matlab file under a directory?
Date: Sat, 10 May 2008 11:50:18 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 24
Message-ID: <g0425q$8d7$1@fred.mathworks.com>
References: <98432fb4-2bd1-4390-bfeb-782fcd0f4a3b@m36g2000hse.googlegroups.com>
Reply-To: "carlos lopez" <clv2clv_00000000_@adinet.com.uy>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1210420218 8615 172.30.248.38 (10 May 2008 11:50:18 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sat, 10 May 2008 11:50:18 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 870136
Xref: news.mathworks.com comp.soft-sys.matlab:467694


zhengquan <zhang.zhengquan@gmail.com> wrote in message
<98432fb4-2bd1-4390-bfeb-782fcd0f4a3b@m36g2000hse.googlegroups.com>...
> Hello,
> 
> I have a directory with lots of subdirectories,	in the
> subdirectories, there are the same scripts to anylyse data
> stored in them. Now I want to traverse the entire directory
> and get the matlab scripts executed in all the
> subdirectories. I am running a linux system. Can anyone tell
> me how to do that?  Thanks!
> 
> Regards,
> Zhengquan
In order to locate all the files with a given sufix, in
linux you can issue the following command in the top directory:

find . -name "*.m" -print
If you want to do this from within matlab, you can resort to
the unix command:
unix('find . -name "*.m" -print')
but I cannot assure how you get the output, etc.
Regards
Carlos