This is the code I have so far:
plot(x,y);
xlabel('Distance (m)');
ylabel('Ball Height (m)');
title('Ball Trajectory');
xlim([0 3]);
ylim([-1 2]);
There is an error saying "Array indices must be positive integers or logical values. Error in task4 (line 21) xlim([0 3]);"
Why is this so? I thought I used the xlim function correctly? How do I fix this? Thank you!

 採用された回答

Walter Roberson
Walter Roberson 2019 年 9 月 29 日

29 投票

At some point you accidentally created a variable named xlim

5 件のコメント

Johannes Matthias
Johannes Matthias 2022 年 11 月 14 日
You're my hero
Cathie Wells
Cathie Wells 2022 年 12 月 14 日
Mine too!
Francesco Bernardini
Francesco Bernardini 2023 年 5 月 18 日
Mine as well!
Muhammad
Muhammad 2024 年 7 月 30 日
Really helpful..
Samuel
Samuel 2024 年 9 月 25 日
it werent no accident

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

その他の回答 (0 件)

カテゴリ

製品

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by