The columns command returns the number of columns in a matrix or tensor A.
A = [[1,2,3],[4,5,6]]; columns(A); 3