1
TI-BASIC / Nspire basic- displaying equation rather than var
« on: March 08, 2011, 10:07:35 pm »
I am still learning the basics of scripting on my Nspire CAS calculator, and am having a problem getting my simple script to work properly
instead of evenodd(x2+x+1, x) returning x2-x+1 i get the variable eq returned to me.
Basically I am trying to use a function like f1(x)=x+2 in a program, only i want to be able to do it in a manner of f(x)=equation
Code: [Select]
1.
Define evenodd(eq,var)=
2.
Prgm
3.
:Local even
4.
:©attempting even(-x)=4x+1 should give -4x+1
5.
:©I want to display an equation, not the variable "eq"
6.
: even(var):=eq
7.
:Disp even(-var)
8.
:EndPrgm
after running evenodd() i do not get the expected result.instead of evenodd(x2+x+1, x) returning x2-x+1 i get the variable eq returned to me.
Basically I am trying to use a function like f1(x)=x+2 in a program, only i want to be able to do it in a manner of f(x)=equation