Re: A Learning TableForm Problem

• To: mathgroup at smc.vnet.net
• Subject: [mg32860] Re: A Learning TableForm Problem
• From: "Allan Hayes" <hay at haystack.demon.co.uk>
• Date: Sat, 16 Feb 2002 04:35:16 -0500 (EST)
• References: <a4ielo\$9ng\$1@smc.vnet.net>
• Sender: owner-wri-mathgroup at wolfram.com

```Carlos,
If you  use -> for the right arrow everything works:

f[x_] := x^3 - 4x^2 - 2x + 8
TableForm[Table[{i, f[i]}, {i, 1, 2, 0.1}],

This is the universal "InputForm" that you can input from any keyboard
(like, for example a^b for a to the power b).
You would find it helpful to read the first part of the Mathematica book -
you can find this in the Help menu.

Remember that the tabel form is for display. If you want to use the list
generated by  Table[...] in later calulations please be aware of the
following:

f[x_] := x^3 - 4x^2 - 2x + 8
tbf = TableForm[lst = Table[{i, f[i]},
{i, 1, 2, 0.1}], TableHeadings ->
{None, {"x", "f(x)"}}]

% (*previous output - this is a comment, not part of the input*)

lst

tbf

We see below that tbf is % or lst with the "Wrapprer" TableForm[...] wrapped
round it to specify how it is to be displayed.

InputForm[tbf]

Of course we can extract lst from tbf:

tbf[[1]]
or
First[tbf]

--
Allan

---------------------
Allan Hayes
Mathematica Training and Consulting
Leicester UK
www.haystack.demon.co.uk
hay at haystack.demon.co.uk
Voice: +44 (0)116 271 4198
Fax: +44 (0)870 164 0565

"Carlos" <k9zm at frontiernet.net> wrote in message
news:a4ielo\$9ng\$1 at smc.vnet.net...
> I need to know why this isn't working for me.  The example I am given is:
> Find an estimate for the zero of the Polynomial.  f(x)=x^3-4x^2-2x+8
>
> On a graph the estimated zero is between (1,2)   and it asks us to divide
> the interval into tenths
>
> f[x_]:=x^3-4x^2-2x+8
> TableForm[Table[{i,f[i]},{i,1,2,0.1}],
>
> The > is as close as I can get to a right arrow sign
>
> The example I have shows a table  with 2 columns and appropriate numbers,
> but I cannot get this to display on Mathematica for me.  Any ideas?
>
> Thanks
> Carlos
>
>
>

```