-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbrl_MCCvals.m
45 lines (40 loc) · 1.58 KB
/
brl_MCCvals.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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
function out = brl_MCCvals(inputstring)
% © 2015 Allen Institute.
% This file is part of smartACT.
% smartACT is free software: you can redistribute it and/or modify it under
% the terms of the GNU General Public License as published by the Free
% Software Foundation, either version 3 of the License, or (at your option)
% any later version. smartACT is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
% General Public License for more details.
% You should have received a copy of the GNU General Public License along with smartACT.
% If not, see <http://www.gnu.org/licenses/>.
%
% This package is currently not maintained and no support is implied.
% Questions may be directed to Brian Long
% <[email protected]> with 'smartACT' in the subject line.
%
% calls to the server to return current multiclamp commander meter values
% return a character array... the values we want are space-delimited
% values in the last line:
out = [];
recording=0;
[zzz r] =strtok(inputstring,' ');
while ~isempty(r)
[zzz r] =strtok(r,' ');
if strcmp(zzz , 'values:')
recording = 1;
end
if recording
out = [out, str2num(zzz)];
end
end
% CRITICAL:
% the first value is sometimes resistance and sometimes voltage. since the
% voltages and currents are small (always less than 10 V) and the
% resistances are large (always greater than 100Ohms), we can adaptively
% correct when the user has clicked or unclicked the 'Resistance' mode
if out(1)<100
out(1) = out(1)/out(2);
end