the following works at least in j803 and gives the same plot as
plot 5 13
plot 0j5 1j13
plot 0 1 j. %:@:(* +)3j4 12j5
the behavior should already documented.
the bug in j602 plot was reported previously, it should not
raise a domain error.
A fix may be converting complex number array that look like real
numbers to true real numbers, something like,
(a;b){::~ *./ a = b=. {."1 +. a=. 5j0 13j0
Сб, 04 окт 2014, jprogramming написал(а):
> Note that (plot 5 13) looks different from (plot 5j0 13j0) even if they are
> equal: (5 13 -: 5j0 13j0). The error message is however a bug.
>
> plot %:@:(* +)3j4 12j5
> |domain error: glcmds
> | glcmds buf
> Venlig hilsen, Bo.
>
>
>
> Den 2:50 lørdag den 4. oktober 2014 skrev Henry Rich <[email protected]>:
>
>
> >
> >
> >Yes. Complex numbers plot differently (they are assumed to be x,y pairs)
> >
> >If you take the real part, using 9&o., it should work. Better to use norm2.
> >
> >Henry Rich
> >
> >On 10/3/2014 7:24 PM, Vijay Lulla wrote:
> >> When I tried it I got the following:
> >>
> >> datatype norm1 3j4 12j5
> >>
> >> complex
> >>
> >> datatype norm2 3j4 12j5
> >>
> >> floating
> >>
> >>
> >> Maybe this could be the issue?
> >>
> >>
> >> On Fri, Oct 3, 2014 at 7:16 PM, bill lam <[email protected]> wrote:
> >>
> >>> I forwarded this to J forum because I have no real knowledge of plot.
> >>> ---------- Forwarded message ----------
> >>> From: "Andrey Paramonov" <[email protected]>
> >>> Date: Oct 4, 2014 7:07 AM
> >>> Subject: Plotting magnitudes of complex numbers in J
> >>> To: <[email protected]>
> >>> Cc:
> >>>
> >>> Hi Bill,
> >>>
> >>> For some reason my message to [email protected] doesn't go
> >>> through, so I thought I can shoot you an email with some strange
> >>> behaviour (bug?) I see in the plot function. Here is the snippet that
> >>> highlights the problem
> >>>
> >>> norm1=: %:@:(* +)
> >>> norm2=: |
> >>> norm1 3j4 12j5
> >>> 5 13
> >>> norm2 3j4 12j5
> >>> 5 13
> >>> load 'plot'
> >>> plot norm2 3j4 12j5 NB. works
> >>> plot norm1 3j4 12j5 NB. does NOT work
> >>>
> >>> I thought you might find it interesting.
> >>>
> >>> Thank you,
> >>> Andrey
> >>>
> >>> P.S. I'm using j64-802.
> >>> ----------------------------------------------------------------------
> >>> For information about J forums see http://www.jsoftware.com/forums.htm
> >
> >>>
> >> ----------------------------------------------------------------------
> >> For information about J forums see http://www.jsoftware.com/forums.htm
> >>
> >----------------------------------------------------------------------
> >For information about J forums see http://www.jsoftware.com/forums.htm
> >
> >
> >
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
--
regards,
====================================================
GPG key 1024D/4434BAB3 2008-08-24
gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3
gpg --keyserver subkeys.pgp.net --armor --export 4434BAB3
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm