We're glad you came by, but you might find what you're looking for elsewhere.
TI-Basic Developer is not the site it once was. While its information on commands and other calculator features remains almost second-to-none, its forum, archives, and even hosting service, Wikidot, have been decaying for years. The calculator community would love to see what you're working on, or help you in your next coding adventure, but TI-Basic Developer is no longer the place to do it.
Instead, you should head over to Cemetech (primarily American) or TI-Planet (primarily international). Both are active, well-established forums with their own archives, chatrooms, reference material, and abundant coding tools and resources. We'll see you there, we hope.
I am writing a program that would allow the user to input two functions and two intervals and then graph the piecewise defined function.
:"piecewise(Y1, X≤0, Y2,X>0)"→Y3
:DispGraph
works fine but I would like to replace the "X≤0" and "X>0" with string inputs. However this results in a data type error. Any suggestions?
—Thread Moved
The piecewise( command page shows how to do this in its first section of code
The first piece of code is
piecewise(Y1,X≥0,Y2,X<0→Y3
This shows the conditions as being hard-coded values, not variables. I would like to do this:
piecewise(Y1,Str1,Y2,Str2)
I'm not sure you read my post completely.
You could try string concatenation
"piecewise(Y1,"+Str1+",Y2,"+Str2→Y3
wouldn't you need a Str>Expr command?
Not for the piecewise( command. The CE and CSE are a little different than the 83/34/+/SE
I would try Trenly Trenly 's suggestion, but I don't think that will work (please let me know if it does in fact work), because conditionals are a mixture of variables and conditional operators. The calculator does not seem to read the expressions the way it reads a string. The only work around I can think of would be to use a menu(s) to give the user the ability to select the desired conditional parameters.
I'm doubtful it will work either, but looking at the example code on the command page, it looks like it is just storing a string into Y3, which is why I thought that concatenation may do the trick