Home > data-access > get_num_obj.m

get_num_obj

PURPOSE ^

SYNOPSIS ^

function out = get_num_obj(subid)

DESCRIPTION ^

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function out = get_num_obj(subid)
0002 
0003 subs = cIDs(subid);
0004 
0005 stim = fullfile(get_multidir_root, 'stimulus_table.txt');
0006 fid = fopen(stim, 'r');
0007 if fid > 0
0008     data = textscan(fid, '%d %d %d %s %s %d %s %d','Headerlines', 1, 'delimiter', ',', 'EmptyValue', -Inf);
0009 else
0010     error('file did no open correctly');
0011 end
0012 fclose(fid);
0013 
0014 data = horzcat(data{[1 2 3]});
0015 out = arrayfun(@(a) sum(data(:,1) == a & data(:,3) == 1), sub2exp(subs));
0016 
0017 
0018 
0019 % out = 0;
0020 % vars = list_variables(subid);
0021 % for o = [3 5]
0022 %     log = strfind(vars, sprintf('obj%d', o));
0023 %     if sum(cellfun(@(a) ~isempty(a), log)) > 0
0024 %         out = o;
0025 %     end
0026 % end
0027 end

Generated on Tue 23-May-2017 03:00:58 by m2html © 2005