Text Option does not work in a Figure (Matlab 2017a)
Mostrar comentarios más antiguos
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
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Matrix Indexing en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!