Issues with ylim?

19 ビュー (過去 30 日間)
Andrew Walters
Andrew Walters 2020 年 12 月 11 日
コメント済み: Andrew Walters 2020 年 12 月 11 日
Hi everyone,
i hope someone can help. I keep getting this error when trying to plot some data:
Array indices must be positive integers or logical values.
Error in ProzPall450 (line 15)
ylim ([-0.5 4])
It has worked previously no problem. Here is some exemplary code. I use Matlab R2020a. Has anyone else been experiencing issues with ylim?
subplot(2,1,1)
yyaxis left
plot (tmin,TMP,'Color',[.02 .24 .39])
ylim ([-0.5 4])
ax = gca;
ax.YColor = 'k'
grid on
title ('A')
xlabel ('Time [min]')
label_1 = ylabel('TMP [bar]')
label_1.Position(1) = -0.05*86.0333
label_1.Position(2) = 1.75

採用された回答

Cris LaPierre
Cris LaPierre 2020 年 12 月 11 日
You have apparently created a variable ylim at some point in your code, which has replaced the ylim function in MATLAB.
Type clear ylim in your command window and try again. If you still get the same error, inspect your code. You have likely named one of your variable ylim (look for ylim=...).
  1 件のコメント
Andrew Walters
Andrew Walters 2020 年 12 月 11 日
Hi Cris, you're right, i had mistakenly defined ylim earlier on. That's solved it, thanks for the help!

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

その他の回答 (0 件)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by