function [y_mean,y_stddev]=plot_sensors_residuals(x,y)
%PLOT_SENSORS_RESIDUALS - plot data, mean and standard deviation

% 
%	$Revision: 1.4 $
%	$Date: 2008/01/19 19:08:39 $
%	$Id: plot_sensors_residuals.m,v 1.4 2008/01/19 19:08:39 duncombe Exp duncombe $
% 
length(x)
plot(x,y,'b+')
hold on
y_mean=median(y);
y_stddev=iqr(y)/1.349;
plot(x,repmat(y_mean,1,length(x)),'r-')
plot(x,repmat((y_mean+y_stddev),1,length(x)),'r--')
plot(x,repmat((y_mean-y_stddev),1,length(x)),'r--')
aux=find(y>=y_mean-(1*y_stddev) & y<=y_mean+(1*y_stddev));
axis([min(x) max(x) y_mean-(5*y_stddev) y_mean+(5*y_stddev)])
length(aux)
return
