%% SL 4

N1 = (-5:5:5)'; N2 = [1:5;2:2:10;primes(11)]; N3 = (1:4)'*(11:14);
N1(1:3)
N1([1 2 3])
N1(1:2)
N1([1 3])
N1([1 3].')
N1([1 3]).'
N1([1; 3])
N1([1 3],1)
N2(1, 3)
N2(3, 1)
N2(1, end)
N2(end, end)
N2(1, :)
N2(1, :).'
N2(:, 2)
N2(:, 3:end)
N3(2:3, [1 1 1]) % like repmat
N3(2:3, ones(1,3))
N3(2:3, ones(3,1))
N3([N2(2,1:2)/2 4], [2 3])
N3([1 end], [1:4 1:2:end])
N3(:, :, 2) = magic(4)
N3([1 3], 3:4, 3) = ...
[1/2 -1/2; pi*ones(1, 2)]

%% SL 5
N1(end:-1:1)
N2(:, 2:2:end)
N3(1:2:end, :)
N2(2, [2 4 5])
A = reshape(1:12, 3, 4).'
A = zeros(3, 4), A(:) = 1:12, A = A.'

%% SL 6
clear; clc;
x = 1:20;
S = cumsum(x);
L = cumsum(x(2:2:end));
L(end)

%% SL
A = magic(6);
B = -magic(6);
A([2:3 5], :) = B([1 1 1], :)

B = repmat(B, 1, 2);
A([2:3 5], :) = B(ones(1, 3), 1:6)

B = B(:, 1:5);
A([2:3 5], 1:5) = B(ones(1, 3), :)

%% SL 11
M(:, :, 1) = eye(3);
M(:, :, 2) = ones(3);
M(:, :, 3) = diag([2 3 5]);
M = cat(3, eye(3), ones(3), diag([2 3 5]));
M(1:2, 1:2, 1) = NaN;

%% SL 19
G = [pi/2 pi 3/2*pi 2*pi]
G > pi
G <= pi
G ~= pi
H = G.'; % then analogously

V = [-pi pi 1 0]
U = [1 1 1 1]
V >= U