Rectangles Problem

David Arnold dwarnold45 at suddenlink.net
Fri Jan 21 18:44:28 CET 2011


HI,

I'm trying to draw some rectangles under a curve. I'm doing something wrong, but not sure what it is, as my rectangles don't show up.

Any suggestions?

David.

a=0
b=2
n=10
h=(b-a)/n

x=linspace(a,b);
y=x^2;
plot(x,y)

xx=a:h:b;
yy=xx^2;
ww=h*ones(xx);
hh=xx^2;

rects=[xx;yy;ww;hh];
col=34*ones(xx);
xrects(rects,col)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20110121/e07c85f4/attachment.htm>


More information about the users mailing list