-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplx_waves.m
28 lines (26 loc) · 862 Bytes
/
plx_waves.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
function [n, npw, ts, wave] = plx_waves(filename, channel, unit)
% plx_waves(filename, channel, unit): Read waveform data from a .plx file
%
% [n, npw, ts, wave] = plx_waves(filename, channel, unit)
%
% INPUT:
% filename - if empty string, will use File Open dialog
% channel - 1-based channel number
% unit - unit number (0- unsorted, 1-4 units a-d)
%
% OUTPUT:
% n - number of waveforms
% npw - number of points in each waveform
% ts - array of timestamps (in seconds)
% wave - array of waveforms [npw, n], raw a/d values
if nargin < 3
error 'Expected 3 input arguments';
end
if (isempty(filename))
[fname, pathname] = uigetfile('*.plx', 'Select a Plexon .plx file');
if isequal(fname,0)
error 'No file was selected'
end
filename = fullfile(pathname, fname);
end
[n, npw, ts, wave] = mexPlex(6, filename, channel, unit);