MATLAB: Plotting graphs with setting the own scales

graphMATLABplotting

I plotted these nonlinear functions
fplot (@ (x)x^2 -2)
hold on
fplot (@(x) sqrt(x+2))
hold on
fplot (@(x) (x^2 + 2)/(2*x-1) )
hold on
fplot (@(x) (x^2 + 2)/(2*x-1) )
hold on
fplot (@(x) 1*x )
hold off
grid on
I donot like MATLAB's build in scaling. I want the scales to be something like 2cm to 1 unit on both axes so that the plot will look exactly like this:
Can anyone please help me out? Thanks.

Best Answer

figure
hold on
fplot (@ (x)x.^2 -2)
fplot (@(x) sqrt(x+2))
fplot (@(x) (x.^2 + 2)./(2*x-1) )
fplot (@(x) (x.^2 + 2)./(2*x-1) )
fplot (@(x) 1*x )
grid on
xlim([0 3.2])
ylim([0 3.2])
axis square
This is not quite exactly the same, but it's a lot closer. Good enough?
Note that you also had some matrix multiplication and division in your function definitions, which I assume was not intended. Take note of the changes I made.