How to Adjust x axis plot values in Matlab?

1 次查看(过去 30 天)
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
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 中查找有关 Annotations 的更多信息

产品


版本

R2013a

Community Treasure Hunt

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

Start Hunting!

Translated by