Path: news.mathworks.com!newsfeed-00.mathworks.com!news.kjsl.com!feeder.erje.net!eu.feeder.erje.net!news.stack.nl!aioe.org!.POSTED!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: importing multiple .dat files
Date: Mon, 25 Mar 2013 20:42:22 -0500
Organization: Aioe.org NNTP Server
Lines: 37
Message-ID: <kique2$ouk$1@speranza.aioe.org>
References: <gus6bt$reh$1@fred.mathworks.com> <1d23a395-4010-405b-b3e5-ca1115ab1a99@googlegroups.com>
NNTP-Posting-Host: pvEXwoSvUSk3hlJ1nKMNtg.user.speranza.aioe.org
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: abuse@aioe.org
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.28) Gecko/20120306 Thunderbird/3.1.20
X-Notice: Filtered by postfilter v. 0.8.2
Xref: news.mathworks.com comp.soft-sys.matlab:791998

On 3/25/2013 7:58 PM, mrichman@intehealth.com 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')
    end

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

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

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

--