MATLAB: Shade areas between graphs

MATLABplotting

I need to shade the areas of graph above y = 1 line and below y = -1 line. How can I do code for that.
Like this one.

Best Answer

Look at area() function in MATLAB. May be that helps with your code.
Below is an example:
x = -3*pi : 0.1 :3*pi;
y_signal = sin(2*x)+sin(1.7*x); % Random signal
threshold = 0.7; % Area lower boundary
figure(1);
clf;
hold on;
area(x, max(y_signal, threshold), threshold,'EdgeColor', 'none', 'FaceColor', 'b');
plot(x, y_signal,'k-',lsz,2);
Here is the result: