Re: Avoiding Null output marker from a function
- To: mathgroup at smc.vnet.net
- Subject: [mg92418] Re: [mg92388] Avoiding Null output marker from a function
- From: Curtis Osterhoudt <cfo at lanl.gov>
- Date: Tue, 30 Sep 2008 21:49:14 -0400 (EDT)
- Organization: LANL
- References: <200809301135.HAA22030@smc.vnet.net>
- Reply-to: cfo at lanl.gov
If Null always shows up as a "multiplier" (as it does in this example), then perhaps the easiest is to just say myList/.Null->1 which will replace all those Nulls (to any real power) with unity. In[641]:= {-0.00005337553998992267` Null^3, 5000.147261086986` Null^3} /. {Null -> 1} Out[641]= {-0.0000533755, 5000.15} Hope that helps! C.O. On Tuesday 30 September 2008 05:35:30 amannuc1 wrote: > Dear Mathematica community, > > I am having difficulties that the documentation has not resolved to > date for me. It is this: > > I have defined a function in a Mathematica notebook and then saved it > as text to include it in a package. The package currently contains two > functions. The function of interest returns a 2-element list. The > numbers the function computes appears to be OK, but an annoying > "Null^3" is appended, presumably as a placeholder for supressed > output. Something like: > > \!\({\(-0.00005337553998992267`\)\ Null\^3, 5000.147261086986`\ Null > \^3}\) > > I would like to eliminate that from the output. When I run the > function from the notebook, no such 'Null's are seen. The function > consists of several steps, intermediate variables, a call to FindRoot, > etc. Semicolons separate these steps, as required. > > Your help is greatly appreciated. > > -Tony > > -- ========================================================== Curtis Osterhoudt cfo at remove_this.lanl.and_this.gov PGP Key ID: 0x4DCA2A10 Please avoid sending me Word or PowerPoint attachments See http://www.gnu.org/philosophy/no-word-attachments.html ==========================================================
- References:
- Avoiding Null output marker from a function
- From: amannuc1 <Anthony.J.Mannucci@jpl.nasa.gov>
- Avoiding Null output marker from a function