-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplx_ad_span_v.m
28 lines (26 loc) · 920 Bytes
/
plx_ad_span_v.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 [adfreq, n, ad] = plx_ad_span_v(filename, channel, startCount, endCount)
% plx_ad_span_v(filename, channel): Read a span of a/d data from a .plx file
%
% [adfreq, n, ad] = plx_ad_span_v(filename, channel, startCount, endCount)
%
% INPUT:
% filename - if empty string, will use File Open dialog
% startCount - index of first sample to fetch
% endCount - index of last sample to fetch
% channel - 0 - based channel number
%
% OUTPUT:
% adfreq - digitization frequency for this channel
% n - total number of data points
% ad - array of a/d values converted to mV
if nargin < 4
error 'Expected 4 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
[adfreq, n, ad] = mexPlex(18, filename, channel, startCount, endCount);