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])
  1 件のコメント
djim djim
djim djim 2020 年 6 月 8 日
thanks

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File Exchange2-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