Question: realtime plotting while values are being calculated.

Say the values of i^2 are being calculated from within a procedure,

 

mytest:=proc(n)

local ans;

    ans:=0;

    for i from 1 to n do

   ans:=ans+i^2;

   end do;

   return ans;

end proc;

 

Could I have a (time series) plot of i^2, while the values are being calculated?

The above is a toy example. What I want to archieve is to track a particular intermidiate values while the procedure is running.

 

Thanks,

 

casper

Please Wait...