MATLAB: Plotting equation with specific input range

plot

I want to plot the equation for x=1-10. However, the plot should just include the out put values less or equale to one and if the value more than one just make one.y>=1
y=(2.*x)./(x+5)
% plot(x,y,'k'),

Best Answer

fnF=@(x) min(1,2*x./(x+5));
x=1:10;
plot(x,fnF(x))
Related Question