Re: TI-85 BASIC Question
[Prev][Next][Index][Thread]
If any one of those values evaluates as complex, the entire matrix will
display as complex... just a TI quirk. You can eliminate the complex part
by using the 'real' function. It drops the complex part of any expression,
including matrices and lists.
>y3 -> S(4,2)
>..
>.. [remaining 8 matrix values come
>.. from evaluating x-0.1 and x+0.1]
>..
>Pause S
>Float
can become
>y3 -> S(4,2)
>..
>.. [remaining 8 matrix values come
>.. from evaluating x-0.1 and x+0.1]
>..
>Pause real S
>Float
At 23:07 11/20/96 -0800, Mark Morse wrote:
>I wrote a program that ends up storing real numbers in a matrix. Sometimes
>the values display as complex numbers [i.e., the square root of 2 is
>displayed as (1.414,0.000)], and sometimes they do not [i.e., the square
>root of 2 is displayed as 1.414]. I need help figuring out why this
>happens, because I am not very experienced using matrices. I am also
>perplexed as to why the same program will sometimes display output
>differently, when only the input is changing [i.e., the y(1) expression and
>x value].
>
>I do not want the matrix values displayed as complex numbers. I'm using
>the PAUSE instruction to enable horizontal scrolling of the display, but
>all those extra zeros -- the imaginary part -- result in a very wide
>display.
>
>The matrix values come from evaluating expressions stored in the y(x) list.
> Here is a condensed sample of my program, the y(x) list and the output:
>
>----------------------------------------
>Fix 3
>..
>.. [input y1 expression and generate y(2) and y(3)]
>..
>{4,3} -> dim S
>..
>.. [input x value; output below reflects x=root 2]
>..
>x -> S(1,2)
>y1 -> S(2,2)
>y2 -> S(3,2)
>y3 -> S(4,2)
>..
>.. [remaining 8 matrix values come
>.. from evaluating x-0.1 and x+0.1]
>..
>Pause S
>Float
>----------------------------------------
>
>
>y1=(9/14)x^(1/3)(x^2-7)
>y2=nDer(y1,x,x)
>y3=nDer(y2,x,x)
>
>
>[[(1.314,0.000) (1.414,0.000) (1.514,0.000) ]
> (-3.713,0.000) (-3.608,0.000) (-3.475,0.000)]
> (.909,0.000) (1.191,0.000) (1.471,0.000) ]
> (2.825,0.000) (2.806,0.000) (2.797,0.000) ]]
>
>
>Thank you for any insight you may provide.
>
> ~ Mark
>
>
+--------------------------------------------------------+
| Peter Kolbus +1.810.474.0872 |
| ae607@detroit.freenet.org #include <disclaimer.h> |
+--------------------------------------------------------+
| Due to financial difficulties, the light at the end of |
| the tunnel has been permanently disconnected. |
| |
| The packet goes out the card, into the copper, out |
| the router, onto the fiber, across the world, thru |
| the copper............ NOTHING BUT NET. |
| |
| ***Written using 100% recycled electrons*** |
| *** (80% post-consumer) *** |
+--------------------------------------------------------+
References: