フィルターのクリア

How can I have a dd-mm-yyyy hh:mm:ss format on my axis x in a plot?

1 回表示 (過去 30 日間)
Milad
Milad 2016 年 5 月 11 日
回答済み: Star Strider 2016 年 5 月 11 日
I would plot a graph rain versus time. when i read my file by xlsread commands matlab does not read my date time. I have to import my excel file by import data icon and then define two vectors rain and time, then i define Y=RAINY x=TIME plot =(x,y) finally, matlab can draw a plot for me. the point is that it makes own format as date time for me on plot, april 2016 or may 2016. 1- i would like to have my own format or similar like DD,MM,YYYY hh:mm:ss because i have data for each minute and excel can show like that.
2- Why matlab can not read date time when i perform command xlsread series? it just shows second column as rain data. only [num,txt,raw] = xlsread(___) can read the date time in text format but i can not put it on my graph. Please, if you have a suggestion or command series let me know.

採用された回答

Star Strider
Star Strider 2016 年 5 月 11 日
‘Why matlab can not read date time when i perform command xlsread series?’
It can. There are several ways to work with the date and time strings. One that will work in all MATLAB versions is to convert them to date numbers with the datenum function. If you have R2014b or later, you can also use the datetime functions. See the documentation for those functions for details on how to use them with your data.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCalendar についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by