Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Access element of a piddle

by syphilis (Canon)
on Mar 14, 2013 at 00:30 UTC ( #1023330=note: print w/ replies, xml ) Need Help??


in reply to Access element of a piddle

There are probably people here who can give a better answer than me. There are *certainly* people on the PDL mailing list who can provide a better answer than I can.

As a quick stab, you could try at():

pdl> help at Module PDL::Core at Returns a single value inside a piddle as perl scalar. $z = at($piddle, @position); $z=$piddle->at(@position); @position is a coordinate list, of size equal to the number of dimensions in the piddle. Occasionally useful in a general context +, quite useful too inside PDL internals. pdl> $x = sequence 3,4 pdl> p $x->at(1,2) 7 at converts any bad values into the string 'BAD'. # line 3108 "Basic/Core/Core.pm.PL (i.e. PDL::Core.pm)" pdl>
but I don't know if that's the best option.

Cheers,
Rob


Comment on Re: Access element of a piddle
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1023330]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (8)
As of 2015-07-31 03:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (274 votes), past polls