Check sphDB

From Bcontrol
Revision as of 20:30, 21 May 2009 by Jerlich (talk | contribs) (New page: <pre> function [vals,varargout]=check_sphDB(name, varargin) % [vals]=check_sphDB(sph_name, varargin) % [vals, rat, date, trial_n]=check_sphDB(sph_name, varargin) % Usage: if you want to ch...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
function [vals,varargout]=check_sphDB(name, varargin)
% [vals]=check_sphDB(sph_name, varargin)
% [vals, rat, date, trial_n]=check_sphDB(sph_name, varargin)
% Usage: if you want to check the value of a certain sph that is in the
% protocols table for your protocol.
%
%
% eg. val=check_sphDB('goodPoke3','ratname','J033','sessiondate','2008-06')
%
% will return the goodPoke3 value from each trial for J033 in June 2008 ordered from earliest to latest.
%
% eg. val=check_sphDB('goodPoke3','protocol','proanti2','sessiondate','2008-06-05')
%
% Will return the goodPoke3 for ALL rats running the proanti2 protocol on
% June 5, 2008.  Note, your query will run much slower if you don't specify
% a rat. (This one took 9 seconds)
%
% if you use a vague name,
%
% eg. check_sphDB('AntiBias','ratname','J033','sessiondate','2008-06')
%
% You get a helpful message that shows all the matching names, so you can
% specify which one you like.
%
% If you specify a sessid you don't need any other specifiers other than
% the sph_name
%
% trial_n		a str with a logical expression. e.g. '=1' or  '<100'
% regexp_name	if this is set to 1, then instead of exactly matching the
%				ratname, we will regexp against the ratname.
% 
% pairs={'ratname'        , '*';...
% 	'sessid'         , [];...
% 	'protocol'       , '';...
% 	'experimenter'   , '%';...
% 	'sessiondate'    , '*';...
% 	'sph_name'       , '';...
% 	'trial_n'        , '>0';...
% 	'regexp_name'    , 0;...
% 	'vals'			, []};