MATLAB: How to plot selected data intervals using ERRORBAR in MATLAB 7.5 (R2007b)

errorbarintervalMATLABplotsignal

I would like to plot data on an interval using ERRORBAR in MATLAB 7.5 (R2007b). For example, I have around 360 points of error but when plotted the plot is very busy and does not illustrate the data very well. I would like to remove a defined interval of that data to make the plot look less crowded.

Best Answer

You can plot intervals in the ERRORBAR function by specifying the indices in the ERRORBAR function. Then you can specify the interval through the error data you would like to plot over the signal. Below is an example of how one would plot random noise in a Sinusoidal signal.
t=linspace(0,1,360);
sig=sin(2*pi*t);
err=randn(1,360);
l=1:5:360; %Indices in interval
err_sam=err(l);
sig_sam=sig(l);
%Plot the Error in the Signal
errorbar(l,sig_sam,err_sam);