Home > atmlab > graphs > fill_between.m

fill_between

PURPOSE ^

fill_between Fill area between f(x, y1) and f(x, y2)

SYNOPSIS ^

function h = fill_between(x, y1, y2, c)

DESCRIPTION ^

 fill_between Fill area between f(x, y1) and f(x, y2)

 FORMAT

   h = fill_between(x, y1, y2, c

 IN

   x       independent coordinate
   y1      lower end of to-be-filled area
   y2      upper end of to-be-filled area
   c       colour

 OUT

   h       handle to patch object

 See also: fill

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

DOWNLOAD ^

fill_between.m

SOURCE CODE ^

0001 function h = fill_between(x, y1, y2, c)
0002 % fill_between Fill area between f(x, y1) and f(x, y2)
0003 %
0004 % FORMAT
0005 %
0006 %   h = fill_between(x, y1, y2, c
0007 %
0008 % IN
0009 %
0010 %   x       independent coordinate
0011 %   y1      lower end of to-be-filled area
0012 %   y2      upper end of to-be-filled area
0013 %   c       colour
0014 %
0015 % OUT
0016 %
0017 %   h       handle to patch object
0018 %
0019 % See also: fill
0020 
0021 x = vec2col(x);
0022 y1 = vec2col(y1);
0023 y2 = vec2col(y2);
0024 h = fill([x; x(end:-1:1)], [y1; y2(end:-1:1)], c);
0025 
0026 end

Generated on Mon 15-Sep-2014 13:31:28 by m2html © 2005