For the specific example of the size function, if you want to know the number of columns in the input array, tell size that you want the size of the input array in the second dimension.
A = ones(3, 4);
numColumns = size(A, 2)
You don't have to assign it to a variable, you can use it inside another function call like this.
disp("A has " + size(A, 2) + " columns.")
Note that there can be a difference between size with a dimension and size without.
B = ones(3, 4, 5);
[numRows, numColumnsTimesNumPages] = size(B)
numColumns = size(B, 2)
See the description of the sz1, ... szN output arguments on the size documentation page for an explanation.