Text Option does not work in a Figure (Matlab 2017a)
Show older comments
I am using Matlab 2017a and somehow can't be able to use the "text" option in Matlab Figure. I am getting two error messages "Index exceeds matrix dimensions" and "Subscript indices must either be real positive integers or logicals". Here are some explames:
>> plot(1:10)
text(2,8,'A Simple Plot','Color','red','FontSize',14)
Index exceeds matrix dimensions.
>> x = linspace(-5,5);
y = x.^3-12*x;
plot(x,y)
xt = [-2 2];
yt = [16 -16];
str = 'dy/dx = 0';
text(xt,yt,str)
Subscript indices must either be real positive integers or logicals.
These simple codes were working when I used Matlab 2015. Could you please help me to figure out why I am getting these error messages?
Thanks,
Paul
Accepted Answer
More Answers (0)
Categories
Find more on Matrix Indexing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!