How to Adjust x axis plot values in Matlab?

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일

0 개 추천

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개)

카테고리

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

제품

릴리스

R2013a

Community Treasure Hunt

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

Start Hunting!

Translated by