I have a problem with changing x-axis values. My data consists of 15 min values for 462 days, so I have 96 values for 1 day and 44352 values for 462 days. For conversion from 96 values to 24 hours on x-axis I used the following statment:
xtickat = 0:60:1425-1;
set(gca, 'XTick', xtickat, 'XTickLabel', cellstr( num2str( mod(round(xtickat .' ./ 60),24))));
which gives the following result:
On the next figure, I would like to have written numbers of days, so the first number is 1 and the last is 462, with few numbers in between:
Thanks for the help in advance.

답변 (1개)

Star Strider
Star Strider 2017년 7월 14일

1 개 추천

In the second figure, I would divide the x-axis values by 96, then plot your data:
plot(fix(x/96), y)

댓글 수: 2

Marcel Topler
Marcel Topler 2017년 7월 15일
Yes, I divided x-axis by 96 and it works exactly like I wanted. Thanks.
Star Strider
Star Strider 2017년 7월 15일
My pleasure.

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

카테고리

도움말 센터File Exchange에서 Data Type Conversion에 대해 자세히 알아보기

태그

질문:

2017년 7월 14일

댓글:

2017년 7월 15일

Community Treasure Hunt

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

Start Hunting!

Translated by