Open In App

Representing the dimensions of array in Julia - Dims() Method

Last Updated : 21 Apr, 2020
Comments
Improve
Suggest changes
Like Article
Like
Report
The Dims() is an inbuilt function in julia which is used to represent the dimensions of the specified AbstractArray.
Syntax: Dims(A) Parameters:
  • A: Specified array
Returns: It returns the represented dimensions of the specified AbstractArray.
Example 1: Python
# Julia program to illustrate 
# the use of Dims() method

# Getting the represented dimensions
# of the specified AbstractArray.
A = [1, 2, 3, 4]
println(Dims(A))

B = (5, 10, 15, 20)
println(Dims(B))
Output:
(1, 2, 3, 4)
(5, 10, 15, 20)
Example 2: Python
# Julia program to illustrate 
# the use of Dims() method

# Getting the represented dimensions
# of the specified AbstractArray.
A = [1 2 3; 4 5 6]
println(Dims(A))

B = cat([1 2; 3 4], [5 6; 7 8], [2 2; 3 4], dims = 3)
println(Dims(B))
Output:

Next Article
Article Tags :

Similar Reads