A=1; D=2; UW=USEDWATTS(A*2880:D*2880); GW=GENERATEDWATTS(A*2880:D*2880); B=GW-UW; b1=B/120; BC=cumsum(b1); data=[UW,GW,BC]; plot(data)