%here we will plot several nonlinear functions using MATLAB vectors. x = 0.01:.01:10; %vector of x values %suppose we want to plot 1/x. %Dividing a constant by a vector, multiplying vectors, or raising them to a %power is not in general defined in mathematics. So in MATLAB, if we typed %y = 1/x, we would get an error. %what we want to do is set each element of y to 1 divided by the %corresponding element of x. In MATLAB putting a period before an %operation means "do this for each element of the vector individually." y = 1./x; %so this works. loglog(x,y,'k'); xlabel('x','FontSize',15); ylabel('y','FontSize',15); %this works for more complicated functions. Just put a period before each % /, ^, or * symbol. y = 1./sqrt(1+x.^2);