Inputting a function as a variable

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.

Forum » Programming & Design / TI-83/84/+/SE Programming » Inputting a function as a variable
Started by: gkenyon gkenyon
Date: 20 Apr 2025 10:32
Number of posts: 1
rss icon RSS: New posts
Summary:
Actually a TI-89 basic question: I can't get a user pre-defined function to work once input as a variable.
Inputting a function as a variable
gkenyon gkenyon 20 Apr 2025 10:32

[Edit- I found a post on programming functions further down the forum and will be working with the info in there]
I'm a total beginner and actually grinding it out on a TI-89. The program is a (hopefully) simple implementation of the midpoint rule for approximating the value of an integral. The first of two basic obstacles is bringing in the function being integrated in a way that allows it to use a list as its mathematical variable.. I am hopeful that once this is clear to me I'll be able to work out the list dimension mismatch problems I'm having on my own.
My first attempt for getting the inputs was using the Request command and converting the strings to numerical variables, which would have been optimum due to the sense of user-friendliness. Once I couldn't make the function input work properly using Request, I tried the Input command. Likewise no dice. Here's the pertinent part of the code:

bold text
: Input "function",g
:Define g(x)=g
(creates a partition of the interval of interest and stores it as list1)
:Define g(list1)=list2

So, the above doesn't work and I think it's the function's problem rather than the list's problem. I'm looking for the output in the list editor and list1 is fine but list2 has a "data type" error.
I tried using FUNC, ENDFUNC but it won't accept the numerical variable, it needs explicit direction. I don't want to apply a function that lives within the program… I want to apply the user's own function.

Thanks for any thoughts whatsoever!

Last edited on 20 Apr 2025 15:31 by gkenyon
by gkenyon gkenyon , 20 Apr 2025 10:32
/forum/t-17096482/inputting-a-function-as-a-variable#post-
Click here to edit contents of this page.
Click here to toggle editing of individual sections of the page (if possible). Watch headings for an "edit" link when available.
Append content without editing the whole page source.
Check out how this page has evolved in the past.
If you want to discuss contents of this page - this is the easiest way to do it.
View and manage file attachments for this page.
A few useful tools to manage this Site.
Change the name (also URL address, possibly the category) of the page.
View wiki source for this page without editing.
View/set parent page (used for creating breadcrumbs and structured layout).
Notify administrators if there is objectionable content in this page.
Something does not work as expected? Find out what you can do.
General Wikidot.com documentation and help section.
Wikidot.com Terms of Service - what you can, what you should not etc.
Wikidot.com Privacy Policy.

AltStyle によって変換されたページ (->オリジナル) /