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!

 Akzeptierte Antwort

Walter Roberson
Walter Roberson am 29 Sep. 2019

29 Stimmen

At some point you accidentally created a variable named xlim

5 Kommentare

Johannes Matthias
Johannes Matthias am 14 Nov. 2022
You're my hero
Cathie Wells
Cathie Wells am 14 Dez. 2022
Mine too!
Francesco Bernardini
Francesco Bernardini am 18 Mai 2023
Mine as well!
Muhammad
Muhammad am 30 Jul. 2024
Really helpful..
Samuel
Samuel am 25 Sep. 2024
it werent no accident

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by