Find the number of columns of an array in julia

Viewed 1339

I have been trying to find the number of columns of an array but apparently the ncols , size, and length functions don't produce the desired output.

Any suggestion on what is the correct way to find the number of columns of an array?

Thanks in advance.

1 Answers

To find the number of rows of an array, X:

size(X, 1)

To find the number of columns

size(X, 2)

For the length of the n'th dimension:

size(X, n)
Related