Tim Holy
unread,Dec 3, 2012, 3:55:22 PM12/3/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to julia...@googlegroups.com
On Monday, December 03, 2012 11:00:58 AM Denny D wrote:
> Hello fellow Julia users! In matlab I can do
>
> [value,index]=max(x)
>
> value will be the greatest element in x, and index its index.
You want "findmax"
If you're coming from Matlab and just getting started with Julia, here's
another tidbit that may make you happy:
julia> findmax
Methods for generic function findmax
findmax(Array{T,N},) at array.jl:1311
Using that as a hint, open base/array.jl in a text editor and navigate to that
line #. You'll see it's implemented just using a for loop---there's no
"magic," it's all plain Julia, yet you're still getting great performance. So
if you don't find something, you can always roll your own. Of course, if it's
really useful, please consider contributing it.
--Tim