It seems you are looking to sumover the index to give a recursive like
sum. The code worked as I would expect. From the help file it indicates
that
puts a single column from $a into $b, and puts a single element
from
each column of $a into $c.
Something like the following does what you want.
for $i (0..nelem($this)-1) { $thati=$that->index(index($this,$i));
$thati++; p "\n",$thati,"\n",$i,"\n" } p $that
Outputs=> [0 1 2 4 5 13 6 7 8 9 10]
Cliff Sobchuk esn 361-8169, 403-262-4010 ext: 361-8169
Fax: 403-262-4010 ext: 361-8170
Nortel Core RF Field Support: All information is Nortel confidential.
-----Original Message-----
From: Hyer, Dr. Edward [mailto:[email protected]]
Sent: July 1, 2009 6:46 PM
To: [email protected]
Subject: [Perldl] Increment on index with redundant indices
Hi PDL Wizards,
perldl> $this=pdl(3,4,5,5,5,5,5,5,5,5)
perldl> $that=pdl(0..10)
perldl> $thisi=index($that,$this)
perldl> $thisi += 1
perldl> p $that
[0 1 2 4 5 6 6 7 8 9 10]
I was hoping for
[0 1 2 4 5 13 6 7 8 9 10]
Any suggestions for how I get this result?
Thanks,
--Edward H.
_______________________________________________
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