Display time in the title

Hey.
I would like to ask whether it´s possible to display a timestamp in the title? Let me make a eksampel:
you can write in your m-file: title(['temperture ',num2str(max(temp)), '[deg]'])
then the max temperture will display in the title.
Is it possible to display the time in the title when the temperture hit the "max" also? (eg. 100 s)
Thank you

 Accepted Answer

Fangjun Jiang
Fangjun Jiang on 13 Nov 2011

0 votes

If you can find the max temperature, you can use the index to find the time.
[MaxTemp,Index]=max(temp); TimeAtMaxTemp=time(Index);
Where time is your time vector. Then you can use same num2str() technique to display it in the title.

2 Comments

Thank you very much.
The temperture hits the maxtemp several times, is it possible to only display the time where it hits maxtemp the first time, without reducing the simulation time?
If all the maximum temperature values are the same (which is unlikely though), the max() function will only return the index for the first one.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!