function[] = set_plot_subject(e) plotwindow = gcf; plotwindow_id = get_plotwindow_id(plotwindow); subj_pop = findobj('Tag', ['subj_pop.' plotwindow_id]); sess_pop = findobj('Tag', ['sess_pop.' plotwindow_id]); trial_slider = findobj('Tag', ['trial_slider.' plotwindow_id]); trial_edit = findobj('Tag', ['trial_edit.' plotwindow_id]); tmp=get(subj_pop, 'Value'); if (iscell(tmp)) sel = tmp{1}; else sel = tmp; end; sess_pop_vals = []; sess_pop_string = ''; for s = 1:length(e.subjects(sel).sessions); if s > 1 sess_pop_string = [sess_pop_string '|' e.subjects(sel).sessions(s).name]; else sess_pop_string = [e.subjects(sel).sessions(s).name]; end sess_pop_vals = [sess_pop_vals s]; end set(sess_pop, 'Value', 1); set(sess_pop, 'String', sess_pop_string); sess = get(sess_pop, 'Value'); subj = get(subj_pop, 'Value'); trial=round(get(trial_slider, 'Value')); plot(e.subjects(subj).sessions(sess).trials(trial));