How to add date and time in a plot by command in matlab?
7 次查看(过去 30 天)
显示 更早的评论
I plot a graph and i wants to give the date and time on the top/bottom of the graph. how it can be done by using editor commands?
1 个评论
采纳的回答
Jan
2014-9-21
yourDate = 735863.622733333; % Perhaps a serial date number
plot(1:10, rand(1, 10)); % a diagram
text(0.01,0.01, datestr(yourDate), ...
'Units', 'normalized', ... % Not depending on the data
'HorizontalAlignment', 'left', ...
'VerticalAlignment', 'bottom');
0 个评论
更多回答(2 个)
Mischa Kim
2014-9-21
Vishnu, you could add to your function or script
text(0,0,datestr(clock))
Would that do the trick?
2 个评论
Mischa Kim
2014-9-21
Sure. With the datestr command you can convert any date to string format, which is what you need for the text command.
tauseef ahmad
2016-4-29
Hi everyone, can anyone help me to subtract the given matrix from the other and exclude the zero from the matrix
xy=[125 133 0 0 0 0 0 0 0 0 0 0 0 0 ; 50 65 0 0 0 0 0 0 0 0 0 0 0 0]
x1y1=[0 0 0 0 0 0 102 0 0 0 0 120 0 0; 0 0 0 0 0 0 63 0 0 0 0 45 0 0]
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Dates and Time 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!