Borrar filtros
Borrar filtros

Problem on code while plotting a graph

1 visualización (últimos 30 días)
Angus Wong
Angus Wong el 19 de Jun. de 2018
Comentada: Star Strider el 19 de Jun. de 2018
I am plotting a graph, with the line:
figure;
hold on ;
.....
title('function');
.....
hold off;
But I ended up with an error of "Index exceeds array bounds." on the title line. How can I solve this?
  4 comentarios
Angus Wong
Angus Wong el 19 de Jun. de 2018
Editada: Angus Wong el 19 de Jun. de 2018
2018a
Paolo
Paolo el 19 de Jun. de 2018
Editada: Paolo el 19 de Jun. de 2018
Star Strider is right, the error is probably not related to the title command.

Iniciar sesión para comentar.

Respuesta aceptada

Star Strider
Star Strider el 19 de Jun. de 2018
Editada: Star Strider el 19 de Jun. de 2018
The actual error is most likely in the line just above your title call.
Check it to be certain it is entered correctly.
EDIT (16:10 UCT)
What is your ‘y’ function?
Note that in your code, and using fplot, ‘y’ must be a function of one variable.
  4 comentarios
Angus Wong
Angus Wong el 19 de Jun. de 2018
Thanks guys, I know where I made the mistake.
Star Strider
Star Strider el 19 de Jun. de 2018
As always, my (our) pleasure.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Line Plots en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by