Hey,
I got a problem with plotting a function stored in a variable.
For example:
x+2 -> w
Graph w
but this doesn't work. What am i doing wrong or is this even possible?
(TI 89T)
Can I safely assume that you're using a TI-89 here, Timijan? W is a number, not an equation, so you'll be literally storing the value of x plus 2 into w; this means you'll get a horizontal line when you graph it. You instead want to store the equation "x+2" into one of the graph functions and graph that.
You actually aren't storing an equation into that variable, you're actually storing the value of X + 2 into W. Is this in a program, or just in general with the equation inputter/graph button?
@KermMartian indeed i am using TI-89. You managed to replay before i could edit my post
@Ashbad i try to use this in a program.
Based on input data and some derivation function is formed and than i try to graph that function.
Now if i try to put this function in "x+2"-> w and graph w, nothing happens. Graph screen is shown but nothing is drawn. If i try to store it in y1 instead of w it says name is reserved.
So even though i thing what i was doing wrong, i still don't know how to make this work.
Ok, I managed to sole it like this:
Code: x+2->w
string(w)->w
"Define y1(x)="&w->q
expr(q)
DispG
Pause
I wrapped your code in [code] tags, good sir. Yup, that's a good way to do things, although why can't you just directly run the Define command?
I have a similar problem. I want to plot a function (particularly, a polinomial) which depends on the variable t. the polinomial is stored in the variable p, so according to the user's guide I should proceed like this:
Code: graph p, t
But when I do this it gives me an error that says "Undefined Variable". I also tried the solution timijan found but it didn't work.
Any idea?
Thanks in advance
Charlie
Have you tried the obvious solution of checking that p is defined? Are you sure you don't have to put the t in quotes?
The Graph command wants an equation entered exactly the same way it would be entered on the Y= screen. You can either do something like:
Graph x+2,x
to graph x+2. Or, you can define the function in a separate variable:
Define w(x)=x+2
and then:
Graph w(x),x
This syntax should work. Make sure the graphing mode in the Mode screen is set to Function first.
It's weird. If I execute for example:
Code: graph 2*t + 1, t
From the home screen, the calculator plots the function 2*t+1, but if I put it in a program it gives an error saying "Undefined variable".
I solved the problem I had, but I had to do this:
Code: "define pos(t)="&p
graph pos(t),t
Where p is an expression that depends on t and it was previously defined.
CharlieMAC wrote:
It's weird. If I execute for example:
Code: graph 2*t + 1, t
From the home screen, the calculator plots the function 2*t+1, but if I put it in a program it gives an error saying "Undefined variable".
Do you happen to have âtâ defined as local with the Local command? It seems that this will cause the error. If so, removing it from Local may help.
Travis wrote:
CharlieMAC wrote:
It's weird. If I execute for example:
Code: graph 2*t + 1, t
From the home screen, the calculator plots the function 2*t+1, but if I put it in a program it gives an error saying "Undefined variable".
Do you happen to have âtâ defined as local with the Local command? It seems that this will cause the error. If so, removing it from Local may help.
I tried both things (t as local and not local), but none of them worked.
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.
»
Go to Registration page
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum