Change plot scale y axis

3 ビュー (過去 30 日間)
Eduard-Mihai
Eduard-Mihai 2022 年 12 月 1 日
コメント済み: Eduard-Mihai 2022 年 12 月 1 日
Hello,
I have 2 vectors i want to plot but i want to change the scale.
Using the code below:
u21=[224 224 224 223 218 218 217];
beta1=[0 0.19 0.26 0.38 0.76 0.83 0.9];
plot(beta1,u21,'-*');
xlabel('beta')
ylabel('U[V]')
grid on
I have obtained this:
But i want my plot to look like this, more like a straight line. The numbers on the y axis in this picture are 0:50:250 where as in my plot from above are exactly the numbers inside the vectors.

回答 (2 件)

Stephan
Stephan 2022 年 12 月 1 日
u21=[224 224 224 223 218 218 217];
beta1=[0 0.19 0.26 0.38 0.76 0.83 0.9];
plot(beta1,u21,'-*');
xlabel('beta')
ylabel('U[V]')
ylim([0 250])
grid on
  1 件のコメント
Eduard-Mihai
Eduard-Mihai 2022 年 12 月 1 日
Thank you for your answer

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


VBBV
VBBV 2022 年 12 月 1 日
u21=[224 224 224 223 218 218 217];
beta1=[0 0.19 0.26 0.38 0.76 0.83 0.9];
plot(beta1,u21,'-*');
xlabel('beta')
ylabel('U[V]')
ylim([0 250]) % use ylim
grid on
  1 件のコメント
Eduard-Mihai
Eduard-Mihai 2022 年 12 月 1 日
Thank you

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

カテゴリ

Help Center および File ExchangeAnnotations についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by