>> x x = Columns 1 through 7 0.0300 0.3000 0.3600 0.7100 0.7400 0.8800 1.9900 Columns 8 through 10 2.2800 2.9600 4.5700 >> y=length(x)-1:-1:0 y = 9 8 7 6 5 4 3 2 1 0 >> ttt=(cumsum(x)+y.*x)/sum(x) ttt = Columns 1 through 7 0.0202 0.1842 0.2166 0.3819 0.3941 0.4413 0.7409 Columns 8 through 10 0.7996 0.8914 1.0000 >> ttt=[0 ttt] ttt = Columns 1 through 7 0 0.0202 0.1842 0.2166 0.3819 0.3941 0.4413 Columns 8 through 11 0.7409 0.7996 0.8914 1.0000 >> t=(0:1:length(x))/length(x) t = Columns 1 through 7 0 0.1000 0.2000 0.3000 0.4000 0.5000 0.6000 Columns 8 through 11 0.7000 0.8000 0.9000 1.0000 >> plot(t,ttt) >> hold on >> plot(t,t) >> hold off >>