readdat.html 4.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
  2. "http://www.w3.org/TR/REC-html40/loose.dtd">
  3. <html>
  4. <head>
  5. <title>Description of readdat</title>
  6. <meta name="keywords" content="readdat">
  7. <meta name="description" content="">
  8. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  9. <meta name="generator" content="m2html &copy; 2005 Guillaume Flandin">
  10. <meta name="robots" content="index, follow">
  11. <link type="text/css" rel="stylesheet" href="../../m2html.css">
  12. <script type="text/javascript">
  13. if (top.frames.length == 0) { top.location = "../../index.html"; };
  14. </script>
  15. </head>
  16. <body>
  17. <a name="_top"></a>
  18. <!-- ../menu.html chronux_2_10 --><!-- menu.html dataio -->
  19. <h1>readdat
  20. </h1>
  21. <h2><a name="_name"></a>PURPOSE <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2>
  22. <div class="box"><strong></strong></div>
  23. <h2><a name="_synopsis"></a>SYNOPSIS <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2>
  24. <div class="box"><strong>function [data,sampling]=readdat </strong></div>
  25. <h2><a name="_description"></a>DESCRIPTION <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2>
  26. <div class="fragment"><pre class="comment">
  27. function for reading *.mat, *.wav and *.au files
  28. *.mat files have to contain variables data and sampling in order for the
  29. returns to work properly</pre></div>
  30. <!-- crossreference -->
  31. <h2><a name="_cross"></a>CROSS-REFERENCE INFORMATION <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2>
  32. This function calls:
  33. <ul style="list-style-image:url(../../matlabicon.gif)">
  34. </ul>
  35. This function is called by:
  36. <ul style="list-style-image:url(../../matlabicon.gif)">
  37. </ul>
  38. <!-- crossreference -->
  39. <h2><a name="_source"></a>SOURCE CODE <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2>
  40. <div class="fragment"><pre>0001 <a name="_sub0" href="#_subfunctions" class="code">function [data,sampling]=readdat</a>
  41. 0002 <span class="comment">%</span>
  42. 0003 <span class="comment">% function for reading *.mat, *.wav and *.au files</span>
  43. 0004 <span class="comment">% *.mat files have to contain variables data and sampling in order for the</span>
  44. 0005 <span class="comment">% returns to work properly</span>
  45. 0006 <span class="comment">%</span>
  46. 0007 [fname,pname]=uigetfile(<span class="string">'*.*'</span>);
  47. 0008 strindex=findstr(fname,<span class="string">'.plx'</span>);
  48. 0009 <span class="keyword">if</span> ~isempty(strindex);
  49. 0010 error(<span class="string">'This file format can be read with Plexon supplied routines in folder ReadingPLXandDDTfilesinMatlab'</span>);
  50. 0011 <span class="keyword">end</span>;
  51. 0012 strindex=findstr(fname,<span class="string">'.ddt'</span>);
  52. 0013 <span class="keyword">if</span> ~isempty(strindex);
  53. 0014 error(<span class="string">'This file format can be read with Plexon supplied routines in folder ReadingPLXandDDTfilesinMatlab'</span>);
  54. 0015 <span class="keyword">end</span>;
  55. 0016 strindex=findstr(fname,<span class="string">'.nex'</span>);
  56. 0017 <span class="keyword">if</span> ~isempty(strindex);
  57. 0018 error(<span class="string">'This file format can be read with Plexon supplied routines in folder HowToReadNexFilesInMatlab'</span>);
  58. 0019 <span class="keyword">end</span>;
  59. 0020 strindex=findstr(fname,<span class="string">'.mat'</span>);
  60. 0021 <span class="keyword">if</span> ~isempty(strindex);
  61. 0022 eval([<span class="string">'load '</span> pname fname]);
  62. 0023 <span class="keyword">end</span>;
  63. 0024 strindex=findstr(fname,<span class="string">'.wav'</span>);
  64. 0025 <span class="keyword">if</span> ~isempty(strindex);
  65. 0026 filename=[pname fname];
  66. 0027 [data,sampling]=wavread(filename);
  67. 0028 <span class="keyword">end</span>;
  68. 0029 strindex=findstr(fname,<span class="string">'.au'</span>);
  69. 0030 <span class="keyword">if</span> ~isempty(strindex);
  70. 0031 filename=[pname fname];
  71. 0032 [data,sampling]=auread(filename);
  72. 0033 <span class="keyword">end</span>;</pre></div>
  73. <hr><address>Generated on Fri 12-Aug-2011 11:36:15 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" target="_parent">m2html</a></strong> &copy; 2005</address>
  74. </body>
  75. </html>