Plotting temperature vs date, which will be a combination of two array?

Situation: Trying to plot temp Vs (month/year) Data given: temp, month, year are all arrays with single column Code used:
dates=datenum([finalmonth,finalyear]);
plot(dates,finaltemp,'b.');
datetick('x','mmmm','keepticks')
Problem with this code: Its is plotting all the point at just one point on x-axis

 채택된 답변

dpb
dpb 2016년 5월 1일
dates=datenum([finalmonth,finalyear]);
isn't correct form for datenum, _"...A partial date vector has three elements, specifying year, month, and day." You've got month and year reversed no day (pick one, "1" is a good choice for plotting).
Use
dates=datenum(finalyear, finalmonth, 1);
instead.

댓글 수: 2

It Worked! Thank you so much.
Then please Vote for his answer and officially "Accept" his answer so he can get reputation points for helping you. Thanks in advance.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Dates and Time에 대해 자세히 알아보기

제품

질문:

2016년 5월 1일

댓글:

2016년 5월 2일

Community Treasure Hunt

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

Start Hunting!

Translated by