broadcast_getindex

broadcast_getindex(A, inds...)

Broadcasts the inds arrays to a common size like broadcast, and returns an array of the results A[ks...], where ks goes over the positions in the broadcast.

Examples

julia> foo = [1 2];
julia> bar = [2; 1];
julia> baz = [8 9; 10 11]
2x2 Array{Int64,2}:
    8       9      
 10     11
julia> broadcast_getindex(baz, foo, bar)      
2x2 Array{Int64,2}:     
 9      11      
 8      10
julia> #    foo -> [1 2; 1 2];  bar -> [2 2;  1 1];
julia> #   [baz[1,2]  baz[2,2];    baz[1,1]   baz[2,1]]

See Also

User Contributed Notes

Add a Note

The format of note supported is markdown, use triple backtick to start and end a code block.

*Required Field
Details

Checking you are not a robot: