% Plotting examples % 4-2-2008 % Clear the previous variables and plotting windows clear all; close all; % Number of points to evaluate at N=1000; % X-Values x=linspace(-10,10,N); % Functions y1=tanh(x); y2=sin(x); % Plots plot(x,y1,'b',x,y2,'r') % Plot the two functions, the first in blue and the second in red axis([-5 5 -1.2 1.2]) % Customize the axis with x=[-5 5] and y=[-1.2 1.2] grid % Turn on the grid title('Our tanh plot') % Put a title on the plot xlabel('x') % Label the x-axis ylabel('tanh(x)') % Label the y-axis