The size()
is an inbuilt function in julia which is used to return a tuple containing the dimensions of the specified array. This returned tuple format is (a, b, c) where a is the rows, b is the columns and c is the height of the array.
Syntax:
size(A::AbstractArray)
or
size(A::AbstractArray, Dim)
Parameters:
- A: Specified array
- Dim: Specified dimension
Returns: It returns a tuple containing the dimensions of the specified array.
Example 1:
A = [ 5 , 10 , 15 , 20 ]
println(size(A))
B = [ 5 10 ; 15 20 ]
println(size(B))
C = cat([ 1 2 ; 3 4 ], [ 5 6 ; 7 8 ], [ 9 10 ; 11 12 ], dims = 3 )
println(size(C))
|
Output:

Example 2:
A = [ 1 , 2 , 3 ];
println(size(A, 3 ))
B = [ 2 4 ; 6 8 ; 10 12 ];
println(size(B, 2 ))
C = cat([ 10 15 ; 20 25 ], [ 30 35 ; 40 45 ],
[ 50 55 ; 60 65 ], [ 70 75 ; 80 85 ], dims = 3 );
println(size(C, 2 ))
|
Output:

Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape,
GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out -
check it out now!
Last Updated :
26 Mar, 2020
Like Article
Save Article