MATLAB: Mark specific values on a plot!

mark values specific plot min max

Hi consider the following plot:
x=1:100;
y=600+(1400-600).*rand(100,1);
plot(x,y)
How can I mark the y values between 900 and 1100? Thanks!

Best Answer

Additional to your code, use the following lines:
yMark=zeros(1,100);%preallocation for speed
for i=1:1:length(y)
if(y(i)>=900 && y(i)<=1100)
yMark(i)=y(i);
end
end
plot(x,yMark,'->')