help-octave
[Top][All Lists]
Advanced

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

Re: dir and path help


From: bpabbott
Subject: Re: dir and path help
Date: Tue, 07 Sep 2010 15:11:23 +0000 (GMT)

On 07 Sep, 2010,at 10:41 AM, dirac <address@hidden> wrote:

Hi everyone,

I want to do some batch analysis i.e. I want to operate some function on a
whole folder. In the function I need to input the file name like so:

>>Function(filename)

I can see that something like:

>>a=dir('*.dat')

will list all of the files in the directory, but I want to perform this
function on another folder where the source files are kept. Is this
possible? I was looking in to the functions path and addpath, but cant seem
to get anywhere.

Thanks in advance :)

Martin
 
I'm not sure I understand exactly what you want to do ... but if the path to your folder is defined by ...

path_to_folder = "/Users/Martin/myfolder";

you can get the list of files by ...

a = dir (strcat (path_to_folder, filesep, "*.dat"))

Ben


reply via email to

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