There are different ways to do this of course, but one is to use NiceSlice:
pdl> $a = zeroes(3, 4, 5)->sequence()
pdl> use PDL::NiceSlice
pdl> p $a((0),(0),:)
[0 12 24 36 48]
J.
On 9 Nov 2011, at 23:47, Denis Gonzalez wrote:
> Hi everyone,
>
> I am beginner in PDL and I have troubles for extracting a 1D list from a big
> 3D matrix.
> For example, the matrix $A is a 3D pdl
>
> $A = zeroes($i,$j,$k);
>
> which is filled with different values from a file. So, now I need to obtain a
> list with all the $k values for a given couple $i,$j. For doing that, for
> example with $i=0, $j=0, I use the slice function
>
> $B = slice $A, "0:0,0:0,0:-1";
>
> print $B
> [
> [
> [6.3039387e-05]
> ]
> ....
> [
> [8.8720632e-05]
> ]
> ....
> [
> [0.00010826399]
> ]
> ]
>
> but I need to obtain something like
>
> $A = [
> 6.3039387e-05
> ...
> 8.8720632e-05
> ...
> 0.00010826399
> ]
>
> Is there some pdl or perl "function" for doing that?
> thanks,
> Denis.
> _______________________________________________
> Perldl mailing list
> [email protected]
> http://mailman.jach.hawaii.edu/mailman/listinfo/perldl
_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl