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!

 Respuesta aceptada

Walter Roberson
Walter Roberson el 29 de Sept. de 2019

29 votos

At some point you accidentally created a variable named xlim

5 comentarios

Johannes Matthias
Johannes Matthias el 14 de Nov. de 2022
You're my hero
Cathie Wells
Cathie Wells el 14 de Dic. de 2022
Mine too!
Francesco Bernardini
Francesco Bernardini el 18 de Mayo de 2023
Mine as well!
Muhammad
Muhammad el 30 de Jul. de 2024
Really helpful..
Samuel
Samuel el 25 de Sept. de 2024
it werent no accident

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Productos

Etiquetas

Preguntada:

el 29 de Sept. de 2019

Comentada:

el 25 de Sept. de 2024

Community Treasure Hunt

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

Start Hunting!

Translated by