I want to plot two functions and have the X and Y axis having smaller intervals than what is being shown.
Here is the plot
and here is my code
x = linspace(-2,2,100);
plot (x, atan(x)), grid on;
ax = gca;
ax.XAxisLocation = 'origin';
ax.YAxisLocation = 'origin';
hold on
plot(x, x-atan(x).*(1+x.^2))
hold off
The x-axis has intervals of 0.5, but the y-axis does not. Could someone please show me how to make the axis's have smaller intervals? I want to 0.1, 0.2, 0.3, and 0.4 between the 0 and 0.5 on the x-axis. Then do the same thing on the $y$-axis.
I'm looking through https://www.mathworks.com/help/matlab/getting-started-with-matlab.html right now, but haven't found how to do what I described above.