function w = whatArray(x)
%WHATARRAY Determines the kind of 2-dimensional array
%   w = whatArray(x) returns:
%
%   1 if x is a scalar
%   2 if x is a vector
%   3 if x is a matrix
%
%   You can assume that x is a 2-dimensional array
%   that is not empty.

[rows, cols] = size(x);
if rows == 1 && cols == 1
    w = 1;
elseif rows ~= 1 && cols ~= 1
    w = 3;
else
    w = 2;
end

