Today I tried to do something like this in MATLAB:

A = zeros(3, 4, 5); % Make a 3D array

plot(A(:, 1, 1));   % Works

plot(A(1, :, 1));   % Works

plot(A(1, 1, :));   % Error using plot: Data may not have more than 2 dimensions

wat.

This is because even if you slice an N-dimensional array down to 1D or 2D, it stays the same dimension unless you slice out the first two dimensions:

>> size(A(1, :, 1))
ans =
     1     4
>> size(A(:, 1, 1))
ans =
     3     1
>> size(A(1, 1, :))
ans =
     1     1     5

The solution? squeeze it. The squeeze function removes singleton dimensions.

    plot(squeeze(A(1, 1, :))); % Works

Really, MATLAB? Couldn’t you have figured that one out on your own?