I have a vector capacity and I want to iterate over this vector in such a way that that in every iteration 480 is subtracted from the resulted vector for example capacity=[750 350 950 650 600 500 450 700 850 950]
loop 1=capacity-480result=[270 -130 470 170 120 20 -30 220 370 470]loop 2=result-480result={-210 -610 -10 -310 -360 -460 -510 -260 -110 -10]
and so on..meanwhile save every result vector I tried different techniques but cant sort out the desired result e.g
for i=1:3result(i)=capacity(i)-480final=[result(i);result(i+1)]end
but I cant understand how to do this.Any expert can help me out in this please?
Best Answer