%

% Copyright 2017 The MathWorks, Inc.
function column = extractDimension(dataValues, dims)
    dims = num2cell(dims);
    if isscalar(dims)
        column = dataValues(:, dims{:});
    else
        column = dataValues(dims{:}, :);
    end

    column = squeeze(column);
    assert(iscolumn(column));
    if ~isreal(dataValues) && isreal(column)
        % complexity is lost for 0+0i
        column = complex(column, cast(0, 'like', column));
    end
end
