How can i plot time series data from CSV

I have a set of time seris data (attachment). how can I plot it in Matlab?

 採用された回答

Star Strider
Star Strider 2016 年 6 月 1 日

1 投票

This works:
[d,s,r] = xlsread('temp.csv');
t = d(:,1);
v = d(:,2);
figure(1)
plot(t, v);
grid
xlabel('Time')
ylabel('Value')

4 件のコメント

Archie TSANG
Archie TSANG 2016 年 6 月 1 日
I have used this set of commands.However the x-axis shows double no. but not time information(HH:MM:SS), how could I show the time information in the graph?
Star Strider
Star Strider 2016 年 6 月 1 日
You didn’t say you wanted it in that format. Use the datetick function:
[d,s,r] = xlsread('temp.csv');
t = d(:,1);
v = d(:,2);
figure(1)
plot(t, v);
grid
datetick('x', 'HH:MM:SS')
xlabel('Time')
ylabel('Value')
This should give you the plot you want.
Archie TSANG
Archie TSANG 2016 年 6 月 2 日
Got it! thank you!
Star Strider
Star Strider 2016 年 6 月 2 日
My pleasure!

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeTime Series Events についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by