readdat

PURPOSE ^

SYNOPSIS ^

function [data,sampling]=readdat

DESCRIPTION ^

 function for reading *.mat, *.wav and *.au files
 *.mat files have to contain variables data and sampling in order for the
 returns to work properly

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [data,sampling]=readdat
0002 %
0003 % function for reading *.mat, *.wav and *.au files
0004 % *.mat files have to contain variables data and sampling in order for the
0005 % returns to work properly
0006 %
0007 [fname,pname]=uigetfile('*.*');
0008 strindex=findstr(fname,'.plx');
0009 if ~isempty(strindex);
0010    error('This file format can be read with Plexon supplied routines in folder ReadingPLXandDDTfilesinMatlab');
0011 end;
0012 strindex=findstr(fname,'.ddt');
0013 if ~isempty(strindex);
0014    error('This file format can be read with Plexon supplied routines in folder ReadingPLXandDDTfilesinMatlab');
0015 end;
0016 strindex=findstr(fname,'.nex');
0017 if ~isempty(strindex);
0018    error('This file format can be read with Plexon supplied routines in folder HowToReadNexFilesInMatlab');
0019 end;
0020 strindex=findstr(fname,'.mat');
0021 if ~isempty(strindex);
0022    eval(['load ' pname fname]);
0023 end;
0024 strindex=findstr(fname,'.wav');
0025 if ~isempty(strindex);
0026    filename=[pname fname];
0027    [data,sampling]=wavread(filename);
0028 end;
0029 strindex=findstr(fname,'.au');
0030 if ~isempty(strindex);
0031    filename=[pname fname];
0032    [data,sampling]=auread(filename);
0033 end;

Generated on Fri 12-Aug-2011 11:36:15 by m2html © 2005