function Cube(lower,upper)
%plots a cube based on the lower corner vectore and the upper corner vector
%function cube(lower,upper)
lx = lower(1);
ly = lower(2);
lz = lower(3);

ux = upper(1);
uy = upper(2);
uz = upper(3);

%lower x plane
Surf1=[
   lx lx lx lx lx
   ly ly uy uy ly
   lz uz uz lz lz];
line(Surf1(1,:),Surf1(2,:),Surf1(3,:));

%upper xplane
Surf2=[
   ux ux ux ux ux
   ly ly uy uy ly
   lz uz uz lz lz];
line(Surf2(1,:),Surf2(2,:),Surf2(3,:));

%connecting edges
line([lx;ux],[ly;ly],[lz;lz]);
line([lx;ux],[uy;uy],[lz;lz]);
line([lx;ux],[ly;ly],[uz;uz]);
line([lx;ux],[uy;uy],[uz;uz]);
