% Plotting the Function 1-x^2
% K. A. Connor 22 October 2015

% The x array is chosen so that the function will go from 1 to zero
x=[0:.001:1];

% The function (note the .^2 to square each element in the vector)
y=1-x.^2;
z=x.^2;

% Plotting
plot(x,y,x,z);
grid;
xlabel('x');
ylabel('y');
title('Plotting Example');
legend('1-x^2','x^2','Location','West');% Note that the dot is not necessary here
axis([0 1 0 1]);