RE: RE: Re: Is it possible to access internal variables?
- To: mathgroup at smc.vnet.net
- Subject: [mg34738] RE: [mg34725] RE: [mg34709] Re: [mg34705] Is it possible to access internal variables?
- From: "David Park" <djmp at earthlink.net>
- Date: Tue, 4 Jun 2002 03:41:50 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
This is one method to obtain individual column formatting in your Table. The
formatting has to go in mem.
SetOptions[NumberForm,
ExponentFunction -> (Null &),
NumberSigns -> {"-", " "},
NumberPadding -> {" ", "0"}];
ClearAll[f, mem]
f[x_] := (x - 3)(x - 4);
mem[func_] := mem[func] = {};
mem[x_, func_] := Module[{t = func[x]},
AppendTo[
mem[func], {NumberForm[x, {12, 11}], NumberForm[t, {3, 2}],
ScientificForm[func'[x], {3, 2},
NumberSigns -> {"-", " "},
NumberPadding -> {" ", "0"}]}];
t];
FindMinimum[mem[x, f], {x, 2}]
TableForm[mem[f], TableHeadings -> {Automatic, {"x", "f[x]",
"f'[x]"}}]
David Park
djmp at earthlink.net
http://home.earthlink.net/~djmp/
> From: DrBob [mailto:majort at cox-internet.com]
To: mathgroup at smc.vnet.net
>
> For a bit more insight and flexibility, try this:
>
> ClearAll[f, mem]
> f[x_] := (x - 3)(x - 4);
> mem[func_] := mem[func] = {};
> mem[x_, func_] := Module[{t = func[x]},
> AppendTo[mem[func], {x, t, func'[x]}];
> t];
> FindMinimum[mem[x, f], {x, 2}]
> NumberForm[
> TableForm[mem[f], TableHeadings -> {Automatic, {"x", "f[x]",
> "f'[x]"}}], 12]
>
> ODDLY ENOUGH, when I tried to use NumberForm within TableForm, the
> result didn't display as a table, so I don't know how to show different
> columns of the table at different display precisions.
>
> QUESTION: Does anybody know how to do that?
>
>
> Bobby Treat
>