clc, clear all, close all

%{
    Store in the array v the multiples of 4
    between 8 and 24
%}
v = 8:4:24

%{
    Remove the last element of v and store the
    result again in the array v.
%}
v(end) = []

%{
    Store in the array v1 the first half of v and
    in the array v2 the second half of v.
%}
v1 = v(1:2)
v2 = v(3:end)

%{
    Create the matrix A having the arrays v1
    and v2 as rows.
%}
A = [v1; v2]

%{
    Divide all the elements of the matrix A by 4
    and store the result again in A.
%}
A = A/4

%{
    Subtract 2 from all the elements of the matrix
    A and store the result again in A.
%}
A = A - 2

% Graphs
f = @(x) x.*cos(x)
g = @(x) sqrt(x) - log(1 + x)
figure
hold on
grid on
I = [0, 20]
fplot(f, I, 'g')
fplot(g, I, 'm')
B = f(A)
C = g(A)
D = B + C'