Graphs can be plotted with filling using the area function.

area([3, 4, 1, -2, 0, 3, 4, 1, 2])
xlim([0, 9])                
Here are some examples of scripts to plot functions with fillings.
%Piecewise Filling
%Define x
x = -2*pi:0.01:2*pi;
%Sin Graph
y = sin(x);
y((x<-pi)|(x>=pi))=0;
fill(x,y,'r'); %'r' determines filling color (red)
grid on; %Activates a grid on the figure
hold on %Holds the first plot on the figure 
%Second plot
%Cos Graph
y = cos(x);
y(x<-pi|x>=pi)=0;
fill(x,y,'k'); % 'k' determines filling color (black)
Another example when different colors are applied:

%Piecewise Filling
%Define x
x = -2*pi:0.01:2*pi;
%Define y(x);
y(x<=0)=cos(x(x<=0));
y(x>0)=sin(x(x>0));
fill(x(x>0),y(x>0),'r'); %'r' determines filling color
hold on
fill(x(x<=0),y(x<=0),'c') %'c' determines filling color
grid on; %Activates a grid on the figure
plot(x,y,'.','markersize',8) % plot function
title({'\rmPiecewise function y(x) = cos\itx\rm, -2\pi \leq x\leq 0,';...
'y(x) = sin\itx\rm,  0 < x\leq 2\pi'})
   
Another example:

%1 Smooth
x = linspace(0,2*pi,100);
y = sin(x);
area(x,y,'facecolor','green')
hold on

%2 Rough
x = linspace(0,2*pi,10);
y = sin(x);
area(x,y) 
hold on

%Label Figure/Plot
title('Sin Function and it''s Rough Approximation')
xlabel('x')
ylabel('sin(x)')
legend('Sin(x)','Rough')			
Two n-by-n matrices A and B are called similar if there exists an invertible n-by-n matrix S such that