Problem on code while plotting a graph

1 view (last 30 days)
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 Comments
Paolo
Paolo on 19 Jun 2018
Edited: Paolo on 19 Jun 2018
Star Strider is right, the error is probably not related to the title command.

Sign in to comment.

Accepted Answer

Star Strider
Star Strider on 19 Jun 2018
Edited: Star Strider on 19 Jun 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 Comments
Angus Wong
Angus Wong on 19 Jun 2018
Thanks guys, I know where I made the mistake.
Star Strider
Star Strider on 19 Jun 2018
As always, my (our) pleasure.

Sign in to comment.

More Answers (0)

Categories

Find more on Line Plots in Help Center and File Exchange

Tags

Products


Release

R2018a

Community Treasure Hunt

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

Start Hunting!