Hi, I'm relatively new to Matlab. I've been trying to annotate some specific points in my graph but keep encountering this error: "Subscript indices must either be real positive integers or logicals.". This error appears even when I used the example code (see below). I noticed that if I start my command window fresh, the example code works fine, but as soon as I load my data, the error appears again both when I plot my own data and when I use the example code. Any idea as to why this is the case? Thanks
x = 0:pi/20:2*pi;y = sin(x);figure % new figure window
plot(x,y)text(pi,0,' \leftarrow sin(\pi)')Subscript indices must either be real positive integers or logicals.
Best Answer