%% Removing Rows or Columns from a Matrix
% The easiest way to remove a row or column from a matrix is to set that row or column equal to a pair of empty square brackets []. For example, create a 4-by-4 matrix and remove the second row.

A = magic(4)
A(2,:) = []

% Now remove the third column.

A(:,3) = []

% You can extend this approach to any array. For example, create a random 3-by-3-by-3 array and remove all of the elements in the first matrix of the third dimension.

B = rand(3,3,3);
B(:,:,1) = [];

% Copyright 2018 The MathWorks, Inc.