Re: Arg[z] that works with zero argument?
- To: mathgroup at smc.vnet.net
- Subject: [mg50888] Re: Arg[z] that works with zero argument?
- From: AES/newspost <siegman at stanford.edu>
- Date: Sun, 26 Sep 2004 05:31:51 -0400 (EDT)
- References: <cj32c8$55k$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
In article <cj32c8$55k$1 at smc.vnet.net>,
Bill Rowe <readnewsciv at earthlink.net> wrote:
> Did you try Arg[z] where z is a list?
>
> Attributes[Arg]
> {Listable, NumericFunction, Protected}
>
> Arg[Table[Random[], {4}]]
> {0, 0, 0, 0}
>
> The attribute Listable tells you Arg will accept a list as a argument and do
> the right thing.
Yes, the problem is that if some of the elements in the argument list of
Arg[z] are zeros, the "right thing" that the standard version of Arg
does for those elements is to return some long string (forget exactly
what it is).
If you then print the returned list in MatrixForm, these elements make
all the columns involved become very wide. I'd like Arg[0] to just
return 0, or maybe "*" or something like that, for those argument list
elements that are themselves 0.
And, you can't use some superficially plausible workaround like
myArg[z_] := If[ Abs[z]==0, 0, Arg[z] ]
because the initial test doesn't do what you want if z is a list.