Plot data with date and time

5 ビュー (過去 30 日間)
Hüseyin Uzun
Hüseyin Uzun 2021 年 6 月 10 日
回答済み: KSSV 2021 年 6 月 10 日
I have an excel file which is created automatically and data is added every 10 minutes. I want to read and plot the days once a day, so I take the last 144 data points. When I plot x and y, the error message "Error using plot. Not enough input arguments."
I know that I have to convert my x vector, which contains the time data, somehow. I have looked at the forums and tried different approaches, but it has not worked so far.
x1=datenum(x,'HH:MM:SS');
This one didn't work especially since I don't know how to add the date next to the time.
so far i have only managed to extract the x and y values, which i need for now, from the excel file:
table=readtable('Datalogger.xlsx');
x=table.DatumUndUhrzeit;
x=x(end-144:end);
y=table.Temp_R_210__C;
y=y(end-144:end);

採用された回答

KSSV
KSSV 2021 年 6 月 10 日
thedates = datetime(datestr((x)));
y = str2double(y) ;
plot(thedates,y)

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGraphics Object Identification についてさらに検索

製品


リリース

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by