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?
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 Exchange에서 Time Series Events에 대해 자세히 알아보기

질문:

2016년 6월 1일

댓글:

2016년 6월 2일

Community Treasure Hunt

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

Start Hunting!

Translated by