Beginning Julia Programming by Sandeep Nagar

Beginning Julia Programming by Sandeep Nagar

Author:Sandeep Nagar
Language: eng
Format: epub
Publisher: Apress, Berkeley, CA


7.8.1 find(), findfirst(), and findnext()

Apart from just sensing the presence of a similar value, sometimes you need to find the exact position of a value inside an array. The positions are addressed by indices. The built-in function find() outputs the same. Another set of built-in functions, findfirst() and findnext(), finds a value for its first occurrence and next to a given index, respectively:

julia> A = collect(1:20); # Array having 1 to 20 numbers

julia> find(isodd,A) # Finding numbers which are odd

10-element Array{Int64,1}:

1

3

5

7

9

11

13

15

17

19



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.