Index: /issm/trunk-jpl/src/m/miscellaneous/prctile_issm.m
===================================================================
--- /issm/trunk-jpl/src/m/miscellaneous/prctile_issm.m	(revision 14196)
+++ /issm/trunk-jpl/src/m/miscellaneous/prctile_issm.m	(revision 14196)
@@ -0,0 +1,87 @@
+%
+%  wrapper for prctile to avoid using the matlab statistics toolbox.
+%
+function [y]=prctile_issm(x,p,dim)
+
+	try
+		y=prctile(argin{:});
+
+	catch me
+
+		if length(size(x)) > 2
+			error('Number of dimensions %d not implemented.',length(size(x)));
+		end
+		if ~exist('dim','var')
+			dim=0;
+			for i=1:length(size(x))
+				if ~dim && size(x,i)>1
+					dim=i;
+				end
+			end
+			if ~dim
+				dim=1;
+			end
+		end
+
+		psize=size(p);
+		if size(p,2)>1
+			p=transp(p);
+		end
+
+		xsize=size(x);
+		if dim==2
+			x=transp(x);
+		end
+
+%  check for any NaN in any columns
+
+		if ~any(isnan(x))
+			x=sort(x,1);
+			n=size(x,1);
+
+%  branch based on number of elements
+
+			if     n>1
+
+%  set up percent values and interpolate
+
+				xi=transp(100.*([1:n]-0.5)/n);
+				y=interp1q(xi,x,p);
+
+%  fill in high and low values
+
+				y(p<xi(1),:)=repmat(x(1,:),nnz(p<xi(1)),1);
+				y(p>xi(n),:)=repmat(x(n,:),nnz(p>xi(n)),1);
+
+%  if one value, just copy it
+
+			elseif n==1
+				y=repmat(x(1,:),length(p),1);
+
+%  if no values, use NaN
+
+			else
+				y=repmat(NaN,size(p,1),size(x,2));
+			end
+
+		else
+
+%  must loop over columns, since number of elements could be different
+
+			y=zeros(size(p,1),size(x,2));
+			for j=1:size(x,2)
+
+%  remove any NaN and recursively call column
+
+				y(:,j)=prctile_issm(x(~isnan(x(:,j)),j),p);
+			end
+		end
+
+		if (min(xsize)==1 && xsize(dim)>1 && psize(2)>1) || ...
+		   (min(xsize)> 1 && dim==2)
+			y=transp(y);
+		end
+	end
+
+end
+
Index: /issm/trunk-jpl/src/m/qmu/dakota_out_parse.m
===================================================================
--- /issm/trunk-jpl/src/m/qmu/dakota_out_parse.m	(revision 14195)
+++ /issm/trunk-jpl/src/m/qmu/dakota_out_parse.m	(revision 14196)
@@ -210,9 +210,9 @@
 end
 
-dmin   =min    (data,[],1);
-dquart1=prctile(data,25,1);
-dmedian=median (data,1);
-dquart3=prctile(data,75,1);
-dmax   =max    (data,[],1);
+dmin   =min         (data,[],1);
+dquart1=prctile_issm(data,25,1);
+dmedian=median      (data,1);
+dquart3=prctile_issm(data,75,1);
+dmax   =max         (data,[],1);
 
 %  same as Dakota scm, Excel correl
Index: /issm/trunk-jpl/src/m/qmu/plot/plot_sampdist_bars.m
===================================================================
--- /issm/trunk-jpl/src/m/qmu/plot/plot_sampdist_bars.m	(revision 14195)
+++ /issm/trunk-jpl/src/m/qmu/plot/plot_sampdist_bars.m	(revision 14196)
@@ -127,9 +127,9 @@
    ~isfield(dresp,'max')
     for i=1:length(dresp)
-        dresp(i).min   =min    (dresp(i).sample);
-        dresp(i).quart1=prctile(dresp(i).sample,25);
-        dresp(i).median=median (dresp(i).sample);
-        dresp(i).quart3=prctile(dresp(i).sample,75);
-        dresp(i).max   =max    (dresp(i).sample);
+        dresp(i).min   =min         (dresp(i).sample);
+        dresp(i).quart1=prctile_issm(dresp(i).sample,25);
+        dresp(i).median=median      (dresp(i).sample);
+        dresp(i).quart3=prctile_issm(dresp(i).sample,75);
+        dresp(i).max   =max         (dresp(i).sample);
     end
 end
