0

I have a matrix like this

a =

1.2000    1.5000    1.1000
1.4000    1.9000    1.3000
1.6000    1.8000    1.7000

I want to draw a cdf graph which these three columns shared in one y-axis in Matlab.

Can anyone help me with this? Many thanks !

user2332706
  • 39
  • 1
  • 2
  • 6

1 Answers1

0

Just use cumsum to compute the matrix of accumulated sums columnwise.

b = cumsum(a)

b = 
    1.2000  1.500  1.100
    2.6000  3.400  2.400
    4.2000  5.200  4.100  

Then call plot which will plot each column in a separate line.

plot(b, '-.');