Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2004
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2004

[Date Index] [Thread Index] [Author Index]

Search the Archive

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.


  • Prev by Date: Re: Re: Programing operations with lists
  • Next by Date: Re: Simple questions with Complex Numbers
  • Previous by thread: Re: Arg[z] that works with zero argument?
  • Next by thread: Re: Arg[z] that works with zero argument?