>
> 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";
>
>
You can also

use PDL::NiceSlice;
$a = zeroes(5,5,5);

$b = $a(0:0,0:0,0:-1);

.... or simpler:

$b = $a(0,0,);

...and to get rid of the brackets, what you need is 'flat'

pdl> p $a(0,0,)->flat


...and you can also do this with a concise NiceSlice syntax by adding ;_

p $a(0,0,;_)

Hope this helps,

Matt


-- 
Matthew Kenworthy / Assistant Professor / Leiden Observatory
Niels Bohrweg 2 (#463) / P.O. Box 9513 / 2300 RA Leiden / NL
_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl

Reply via email to