0001 function [stiminfo, stim_fields] = mysql_get_expstims(resp_tbl,varargin)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 stiminfo = {};
0014
0015
0016 narg = length(varargin);
0017 for iarg = 1:2:narg
0018 switch varargin{iarg}
0019 case 'conn_id'
0020 conn_id = varargin{iarg+1};
0021 otherwise
0022 fprintf('mysql_get_expstims: Unknown input argument: %s\n', varargin{iarg});
0023 end
0024 end
0025
0026
0027 if ~exist('conn_id','var') || isempty(conn_id) || mysql(conn_id,'status')
0028 error('%s: Do not have a valid connection ID', mfilename);
0029 end
0030
0031
0032 mysql_str = sprintf(['SELECT DISTINCT stimulus_id FROM %s ' ...
0033 'WHERE stimulus_id IS NOT NULL;'], resp_tbl);
0034 [stimids] = mysql(conn_id,mysql_str);
0035
0036 [stiminfo, stim_fields] = mysql_get_stim_attributes('stimulus_id',stimids,conn_id);
0037
0038 return
0039
0040