I have a MATLAB/Octave program for which I used the tic and toc functions to measure the time elapsed for some calculations. e.g.:
tic();
for k=1:200
...
...
end
time=toc();
so now I have the value time.
how can I include this (anywhere and anyhow) automatically on a plot? as a legend? as a label? as a title?
You can do this with the
num2str-function. To display time in the title use for example: