ET_PDToolkit/PDToolkit/@PDExperiment/set_plot_trial_edit.m

28 lines
749 B
Matlab

function[] = set_plot_trial_edit(e)
plotwindow = gcf;
plotwindow_id = num2str(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]);
trial=str2num(get(trial_edit, 'String'));
min_trial = get(trial_slider, 'Min');
max_trial = get(trial_slider, 'Max');
if ((trial >= min_trial) && (trial <= max_trial))
set(trial_slider, 'Value', trial);
else
display('Trial id does not exist');
%set(trial_slide, 'Value', min_trial);
end
sess = get(sess_pop, 'Value');
subj = get(subj_pop, 'Value');
plot(e.subjects(subj).sessions(sess).trials(trial));