Set elements at a given index of array in Julia - setindex!() Method Last Updated : 28 Apr, 2025 Comments Improve Suggest changes Like Article Like Report The setindex!() is an inbuilt function in julia which is used to store values from the given array X within some subset of A as specified by inds. Syntax: setindex!(A, X, inds...) Parameters: A: Specified function.X: Specified array.inds: Specified index. Returns: It does not return any values. Example 1: Python # Julia program to illustrate # the use of Array setindex!() method # This function store values from an array # X within some subset of A as # specified by inds. A = zeros(2, 2); setindex !(A, [5, 10], [1, 2]); A[[3, 4]] = [15, 20]; println(A) Output: Example 2: Python # Julia program to illustrate # the use of Array setindex!() method # This function store values from an array # X within some subset of A as # specified by inds. A = ones(2, 2); setindex !(A, [2, 4], [1, 2]); A[[3, 4]] = [6, 8]; println(A) Output: Comment More infoAdvertise with us Next Article Set elements at a given index of array in Julia - setindex!() Method K Kanchan_Ray Follow Improve Article Tags : Julia Similar Reads Getting exclusive elements of a set in Julia - setdiff() and setdiff!() Methods The setdiff() is an inbuilt function in julia which is used to returns the elements which are in first set but not in second set. Syntax: setdiff(s, itrs...) Parameters:  s: Specified first set.itrs: Specified second set. Returns: It returns the elements which are in first set but not in second s 1 min read Accessing element at a specific index in Julia - getindex() Method The getindex() is an inbuilt function in julia which is used to construct array of the specified type. This function is also used to get the element of the array at a specific index. Syntax: getindex(type, elements...])Parameters:  type: Specified type.elements: Specified list of elements. Returns 2 min read Get next true value from a given array index in Julia | Array findnext() Method The findnext() is an inbuilt function in julia which is used to return the next coming index after or including i of a true element of the specified array A, or returns zero if true value is not found. Here values of index or key start from 1 i.e, for index of 1st element is 1, index of 2nd element 2 min read Searching in Array for a given element in Julia Given an array (1D, 2D or 3D), and an element to look for in the array. If the element is present in the array, then print the position of the element in the array, else print "Element not found". In the recent updates to Julia, the developers have unified the search() and find() functions into a si 6 min read Get array dimensions and size of a dimension in Julia - size() Method 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) P 2 min read Like