MATLAB: Plotting one variable function

2-d plotMATLAB

i want to plot a graph:
y axis: 4/(1+Ri)^2
xaxis: (1+Ri)/(2*(1-Ri)) : it should vary from 2 to 25
Ri is the only variabe.
i tried with both fplot and plot command but both are giving me different plot.
just want to know what is the correct method to plot this.?

Best Answer

xfun = @(Ri) (1+Ri)./(2*(1-Ri));
yfun = @(Ri) 4./(1+Ri).^2;
zfun = @(Ri) zeros(size(Ri));
h = fplot3(xfun, yfun, zfun, [3/5, 50/51]); view(2); xlim([2 25]); ylim([1 1.6])
The correct upper bound for Ri should be 49/51 but in practice if you use that, fplot3 cuts off at 19 point something.