erator that is a restriction of the existing one. The indexing
% used is the same as in MATLAB matrices; we can specify rows, columns, or
% individual elements, we can extract rows or columns in reverse, and we
% can repeat entries:

x = [1;2;3;4;5];
A = opDiag(x); % Create a 5x5 operator with x's values on its diagonal
B = A(2:4,:);  % Extract rows 2-4 of A
double(B)

%%
% We can also assign values to a subset of an operator, again using the same
% syntax as in MATLAB matrices. The row and column indices w