%% Matlab Project 0
% Write the full names of the members of your group here.
%% Problem 1
% Let $$A=\begin{array}{cc}4 & 2 \\ 1 & 3 \end{array}$ and
% $$B=\begin{array}{cc}0 & 7 \\ 4 & 5 \end{array}$. Create the
% corresponding matrices in MATLAB and calculate $$C=AB$.
% As you can see, MATLAB has the capability to render LaTeX expresions.
A=[4,2;1,3]
% This creates the matrix A. Here the comment is superfluous,
% but you have to comment your code sometimes to explain what you
% are doing.
B=[0,7;4,5];
% We do not really need to see what $$B$ is.
C=A*B
% But we do want to see what the matrix $$C$ is.
%%
% This is how we go back to text mode in case we need to
% answer any questions in the problem.
%% Problem 2
% Plot the graph of the function $$f(x)=\sin^2 (x)$ for $$x \in [-\pi,\pi]$.
x = linspace(-pi,pi,100);
% MATLAB only knows about vectors. This line creates an array with
% 100 equally spaced numbers on $$[-\pi,\pi]$
y = sin(x).*sin(x);
% This calculates the squared of the sine of every number in the array.
plot(x,y)
xlabel('x')
ylabel('sin(x)')
title('Plot of sin^2(x)')
% Make sure to label your figures clearly.
%%
% Finally, make always very clear what problem and what part of it you are
% solving.