Skip to content

Instantly share code, notes, and snippets.

@mathsam
Last active December 14, 2015 20:39
Show Gist options
  • Save mathsam/5145479 to your computer and use it in GitHub Desktop.
Save mathsam/5145479 to your computer and use it in GitHub Desktop.
plot an ensemble of data
function ave_Y = plot_ensemble(gamma,Y)
% input: gamma(N); Y(m,N)
% plot average shading for the N experiments
% return the mean
alpha_confidence = 0.1; % significance level
if length(gamma) ~= size(Y,2)
error('Y has the wrong size');
return
end
[muhat,sigmahat,muci,sigmaci] = normfit(Y,alpha_confidence);
fill(vertcat(gamma(:),flipud(gamma(:))),...
vertcat(muci(2,:)',flipud(muci(1,:)')),'r','LineStyle','none');
ave_Y = muhat;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment