# Plot CPU time vs iteration? [duplicate]

I would like to generate a plot of CPU time vs number of iterations. For example, if I were to calculate the solution of a system of differential equations in state-space form using the summation of e^(A t) (or any series expansion for that matter):

A = {{1, 2}, {3, 4}}
sol=Sum[(MatrixPower[A, j] t^j)  /j!, {j, 0, 200}]


I tried:

Table[Timing[N[Sum[(MatrixPower[A, j] t^j)  /j!, {j, 0, i}]]], {i, 0,
200}]


but this outputs the solution of the summation along with the time. I only require the cpu time for each individual iteration and the iteration number. Can someone point me in the right direction here?

-

## marked as duplicate by Michael E2, belisarius, m_goldberg, Sjoerd C. de Vries, rasherJul 8 at 6:48

It's very intriguing that you've managed the problem till this point but now you don't know how to plot it. –  belisarius Jul 8 at 4:09
I never said I didn't know how to plot it, I asked how to plot the timing of each individual evaluation. But, thanks for not attempting to help nonetheless. –  gKirkland Jul 15 at 0:45

Table[First@Timing[N[Sum[(MatrixPower[A, j] t^j)/j!, {j, 0, i}]]], {i, 0, 200}]

If you want the iteration number side by side, just change the body of the Table to {i, First@...}.