From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: importing multiple .dat files
Date: Mon, 25 Mar 2013 20:42:22 -0500
Organization: NNTP Server
Lines: 37
Message-ID: <kique2$ouk$>
References: <gus6bt$reh$> <>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/20120306 Thunderbird/3.1.20
X-Notice: Filtered by postfilter v. 0.8.2
Xref: comp.soft-sys.matlab:791998

On 3/25/2013 7:58 PM, wrote:
> On Monday, May 18, 2009 1:37:01 PM UTC-4, Dominic  wrote:
>> I am trying to write a for loop which will allow me to import
>> multiple .dat files of different sizes all from the same folder.
>> Thus far I have written the code to import a single file, but when
>> I  try making the necessary changes to loop it I get all sorts of errors.
>> Here is my code so far:
>> %load the dat file
>> [FileName, FilePath, FILTERINDEX] =...
            uigetfile('C:\Dominic\PT40491\data\*.dat', ...
            'Select a Holter file to read') ...
            'MultiSelect', 'on');
    % check didn't CANCEL...
    if isequal(filename,0)
        error('No file(s) selected')

    for f=FileName
      % fixup stupid difference in uigetfile return...
      if iscell(f), f=char(f); end
      % build the full name from pieces parts...

>>   %load the ECG data
>>   [sample V5 AP]=textread(fName,'%f%f%f');
      % do whatever w/ data for this file here...
      % next file

No idea on what a Holter file is, sorry; just saw the query about 
multiple files w/ no answer.