How to Adjust x axis plot values in Matlab?

조회 수: 3 (최근 30일)
djim djim
djim djim 2020년 6월 7일
댓글: djim djim 2020년 6월 8일
Hi,
I need to plot the following function in matlab
M= [0.47 0.49 0.50 0.50 0.51 0.51 0.51 0.51 0.51 0.52 ];
Range= 5:2:23;
plot(Range,M);
So the x-axis values are automatically set by matlab as : 6 8 10 12 14 16...24
how to set them as 5 7 9 11 13 15 .... 23 ?
by the way am using matlab 2013

채택된 답변

Thiago Henrique Gomes Lobato
Thiago Henrique Gomes Lobato 2020년 6월 7일
Use the xticks and xlim functions:
M= [0.47 0.49 0.50 0.50 0.51 0.51 0.51 0.51 0.51 0.52 ];
Range= 5:2:23;
plot(Range,M);
xticks(5:2:23);xlim([5,23])

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

제품


릴리스

R2013a

Community Treasure Hunt

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

Start Hunting!

Translated by