How to adjust the plot range of the y axis in matlab?

I need to build the following functions in matlab

y1=sign(x)
y2=tanh(x)
y3=(x)/(x+1)

The x-range is 5.5 with an interval of 0.1. The y-plot range should be between -1.5 and 1.5.

Each graph should have a designated x and y axis and a legend in the lower right corner.

The only thing I can not understand is to adjust the range of plots. Ive tried editing the actual figure, but all that seems to be is to distort the graph. Is there a command in Matlab that will allow me to adjust the range of the y-axis plot?

Another thing that I still do not understand is adding a legend, I can do this after creating the figure, but I think that this should be done using the matlab command.

+6
source share
2 answers

, axis plot:

axis([-5 5 -1.5 1.5])
+9

y- x-,

ylim([-1.5 1.5])

axis([-inf inf -1.5 1.5]). MATLAB-: https://de.mathworks.com/help/matlab/ref/ylim.html

PS: axis equal x y (. MATLAB)

0

Source: https://habr.com/ru/post/1525066/


All Articles