Function [] = sample_function() % This function can serve as a starting point for writing your own data analysis scripts. %Load in your data file load mydata; %Calculate the means of every other row data_mean_odds = mean(mydata(1:2:end,:)); data_mean_evens = mean(mydata(2:2:end,:)); %Calculate the standard errors for means std_err_odds = SEM(mydata(1:2:end,:)); std_err_evens = SEM(mydata(2:2:end,:)); %plot two figures, one for odds, one for evens figure; %open new figure window errorbar(data_mean_odds, std_err_odds); figure; errorbar(data_mean_evens, std_err_evens); %try plotting both on one graph for direct comparison figure; errorbar(data_mean_odds, std_err_odds); hold on; % turn hold on, so that next plot command does not overwrite last plot %plot evens in red (default line color is blue, use '-r' for red) (c -cyan, g - green) errorbar(data_mean_evens, std_err_evens, '-r');