diff --git a/@gramm/stat_summary.m b/@gramm/stat_summary.m index dd7808c..1bb3164 100644 --- a/@gramm/stat_summary.m +++ b/@gramm/stat_summary.m @@ -159,7 +159,7 @@ warning('bin_in in stat_summary() not supported for Matrix/Cell X/Y inputs'); end - if strfind(params.type,'fit') + if ischar(params.type) && ~isempty(strfind(params.type,'fit')) %If we have a params.type using distributions fits we %can't vectorize the call to computeci so we do it in a for %loop @@ -346,6 +346,19 @@ return; end +if isa(type,'function_handle') + try + temp=type(y); + ymean=temp(1,:); + yci=temp(2:3,:); + catch ME + disp(['Error in custom summary computation: ' ME.message ' ...skipping']); + yci=repmat([NaN NaN],size(y,2)); + ymean=nan(size(y,2),1); + end + return; +end + try switch type case 'bootci'