フィルターのクリア

How to add date and time in a plot by command in matlab?

11 ビュー (過去 30 日間)
Vishnu
Vishnu 2014 年 9 月 21 日
回答済み: tauseef ahmad 2016 年 4 月 29 日
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
Jan 2014 年 9 月 21 日
編集済み: Jan 2014 年 9 月 21 日
What does "editor commands" mean?
Creating an answer would be more efficient, if you explain more details, e.g. where the date should appear, how the date is stored and what you have tried already.

サインインしてコメントする。

採用された回答

Jan
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');

その他の回答 (2 件)

Mischa Kim
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 件のコメント
Vishnu
Vishnu 2014 年 9 月 21 日
Thank you for your answer.But this command will give the current date and time only. Actually i wants to insert an old date and time and i wants to position it to the left side bottom of the plot also.is it possible?
Mischa Kim
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
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]

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by