Getting tuple or range of the valid indices in Julia – axes() Method
Last Updated :
26 Mar, 2020
The axes()
is an inbuilt function in julia which is used to return the tuple or valid range of valid indices for specified array.
Syntax:
axes(A)
or
axes(A, d)
Parameters:
- A: Specified array.
- d: Specified dimension.
Returns: It returns the tuple or valid range of valid indices for specified array.
Example 1:
println(axes(fill( 4 , ( 5 ))))
println(axes(fill( 5 , ( 2 , 3 ))))
println(axes(fill( 4 , ( 2 , 3 , 4 ))))
|
Output:
Example 2:
A = fill( 4 , ( 5 ));
println(axes(A, 1 ))
B = fill( 5 , ( 2 , 3 ));
println(axes(B, 2 ))
C = fill( 4 , ( 2 , 3 , 4 ));
println(axes(C, 3 ))
|
Output:
Share your thoughts in the comments
Please Login to comment...