Many thanks!
I've been programming Perl since 1996, and was loosing faith in the
language until I found PDL -- a whole new world!
Thanks again
Lee
On 02/01/2013 16:26, David Mertens wrote:
Lee -
In addition to this mailing list, you can hop on to the #pdl irc
channel at irc.perl.org <http://irc.perl.org> for a live discussion
group. If you don't have an irc client or have never used one, follow
this link: http://www.mibbit.com/chat/?url=irc://irc.perl.org/pdl
David
On Wed, Jan 2, 2013 at 9:14 AM, Craig DeForest
<[email protected] <mailto:[email protected]>> wrote:
Sure. The NiceSlice syntax in PDL is very similar to MatLab's
slicing syntax. You want to use either:
$a->($i,:)
or
$a->slice("$i,:")
to specify the slice on the left hand side there. You may be
running into the difference between direct assignment and computed
assignment. PDL distinguishes between assignment to *create* a
new PDL ("direct assignment") and assignment to *fill* an old PDL
("computed assignment"). If you want to put values into a slice
you want the ".=" operator (computed assignment) instead of the
"=" operator (direct assignment).
On Jan 2, 2013, at 7:56 AM, Lee Goddard <[email protected]
<mailto:[email protected]>> wrote:
> I have been using PDL for about four hours now, and have got
stuck with the following.
>
> I havethe following from MATLAB:
>
> fori=1:length(in)
> s(i,:)=exp(-((in(i)-bin_locations).^2)/sigma);
> end
>
>
> I am having problems finding out how to translate to PDL the
left-hand side of the assignment: s(i,:)
>
> Please would somebody advise?
>
> I looked at 'set' but it apparently only sets 'a single value
inside a piddle' [1]. It also says it has been superseded by
slice, but that man page says slice is used to 'extract a
rectangular slice of a piddle, from a string specifier.'[2]
>
> Incidentally, is there a good book on PDL in general, or perhaps
specifically for MATLAB users?
>
> Many thanks in anticipation
> Lee
>
> [1] http://pdl.perl.org/PDLdocs/Core.html#set
> [2] http://pdl.perl.org/PDLdocs/Slices.html#slice
>
> _______________________________________________
> Perldl mailing list
> [email protected] <mailto:[email protected]>
> http://mailman.jach.hawaii.edu/mailman/listinfo/perldl
>
_______________________________________________
Perldl mailing list
[email protected] <mailto:[email protected]>
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl
--
"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it." -- Brian Kernighan
_______________________________________________
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