Post Reply 
Plotting a user function?
02-09-2014, 01:09 AM (This post was last modified: 02-09-2014 01:16 AM by veeblefester.)
Post: #1
Plotting a user function?
I have a user function defined and working.

Forgive my ignorance, I cannot figure out how to plot a USER function.

I can enter and 'check' and plot a function in one of the V0 thru V9 built in functions in Advanced Graphing Symbolic View.

How do I plot a USER function from a PROGRAM?

Thanks in advance for any help.

Happy coding and may you see ' i No errors in the program ' with every compilation.
Find all posts by this user
Quote this message in a reply
02-09-2014, 11:01 AM
Post: #2
RE: Plotting a user function?
Hello,
You could:
- assign your equation to V1,V2,.. with a V1:= your_eq_goes_here;
- invoke the advanced graphic application through the STARTAPP("name_of_the_app") command
- uncheck all the other V# with a loop with the command UNCHECK(4); UNCHECK(5),....
- invoke the plot screen via STARTVIEW(1);

I was not very happy when I didn't see a simple calculation program in the prime manual in the programming chapter but now that i am able to do it thanks to this forum, i can appreciate the very long DICE program which shows how to bend the builtin applications for my needs.

Hope it helps,

Giancarlo
Find all posts by this user
Quote this message in a reply
02-10-2014, 06:51 AM (This post was last modified: 02-10-2014 06:58 AM by veeblefester.)
Post: #3
RE: Plotting a user function?
Thanks for the response.

The solution, I realized, is that the proper variable in my equation must be named X.

As in f(X).

Happy coding and may you see ' i No errors in the program ' with every compilation.
Find all posts by this user
Quote this message in a reply
02-28-2014, 02:21 AM
Post: #4
RE: Plotting a user function?
(02-09-2014 11:01 AM)Giancarlo Wrote:  
- uncheck all the other V# with a loop with the command UNCHECK(4);

Just a comment: you can pass lists to UNCHECK. For example, UNCHECK(MAKELIST(X,X,0,9)) will uncheck all 10 user formulas.
Find all posts by this user
Quote this message in a reply
02-28-2014, 07:00 AM
Post: #5
RE: Plotting a user function?
This shinks the code even more,

Thanks for the trick

Giancarlo
Find all posts by this user
Quote this message in a reply
10-01-2015, 07:17 PM
Post: #6
RE: Plotting a user function?
(02-28-2014 02:21 AM)jte Wrote:  
(02-09-2014 11:01 AM)Giancarlo Wrote:  
- uncheck all the other V# with a loop with the command UNCHECK(4);

Just a comment: you can pass lists to UNCHECK. For example, UNCHECK(MAKELIST(X,X,0,9)) will uncheck all 10 user formulas.

Interestingly, on the Android emulator UNCHECK seems able to handle lists for Function, but not for Solve. The embedded help for UNCHECK only describes the UNCHECK(n) syntax.

Code:

EXPORT TRYS()
BEGIN
 SolveTRY.E1:=QUOTE(X^2+X=0);
 SolveTRY.E2:="X^2+X=0";
 SolveTRY.UNCHECK(1); //WORKS
 Function.UNCHECK({1,2});//LIST WORKS ON FUNCTION
 //SolveTRY.UNCHECK(MAKELIST(X,X,1,9)); //DOESNT WORK ON SOLVE

END;

(The problem relates to the use of a list, the MAKELIST is not significant).

Stephen Lewkowicz (G1CMZ)
https://my.numworks.com/python/steveg1cmz
Visit this user's website Find all posts by this user
Quote this message in a reply
10-02-2015, 05:26 AM
Post: #7
RE: Plotting a user function?
Hello,

> The embedded help for UNCHECK only describes the UNCHECK(n) syntax.

The list use of most function is NOT described in the function help itself (as a mater of fact, I do not know where it is described)...

The reason for this is that, deep down, the functions do NOT implement list processing.

List processing is implemented at the level evaluating the function, not in the function evaluation.

So, if the system sees a + and see that arg 1is a list and arg 2 is NOT a list, then it will call + n times, with each element of list 1 and with a copy of arg 2 and construct the resulting list. The + function is NOT aware that it is doing list processing.

This is great, because any new function created WILL implement list processing automatically/by itself, without the function creator having to do anything.

But it means that it is often an overlooked function when doing documentation.

Some functions specifically flag the evaluator as: Not list processing friendly. In this case, list processing does get disabled. As a general rule, this is the case for all the functions that have special processing for lists.

Cyrille

Although I work for the HP calculator group, the views and opinions I post here are my own. I do not speak for HP.
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)