필터 지우기
필터 지우기

If I have day month and Year in Xaxis, How can apply limit to the Xaxis?

조회 수: 2 (최근 30일)
I want to Plot the data for every month and year, so How can i apply the xlimit?

채택된 답변

Star Strider
Star Strider 2022년 3월 22일
If ‘x’ is a datetime array, the arguments to xlim must also be datetime values —
x = datetime('now')+days(0:60);
y = sin(2*pi*5*(0:numel(x)-1)/numel(x));
figure
plot(x,y)
grid
title('Original')
figure
plot(x,y)
grid
xlim([datetime('12-Apr-2022') datetime('12-May-2022')])
title('With ‘xlim’')
.
  댓글 수: 8
Meghraj Kc
Meghraj Kc 2022년 3월 23일
Thank you for the help!!
I understood and applied to my code.
Thank you

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Formatting and Annotation에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by