HP Forums

Full Version: Programming in hp prime
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi
I am actually studying maths in France and i want to create a programm that draw a fonction with a parameter.
In the programm, i get a syntax error when i put "plotfunc", so i dont know how to draw the graph.
I can t find the answer in the user guide, so i would like to know how to draw a graph from a programm.
Thanks for your help
(10-29-2019 05:25 PM)losipi Wrote: [ -> ]Hi
I am actually studying maths in France and i want to create a programm that draw a fonction with a parameter.
In the programm, i get a syntax error when i put "plotfunc", so i dont know how to draw the graph.

plotfunc is a CAS function, try to create a CAS program and execute it in the CAS view.

Code:

#cas
MYGRAPH():=
BEGIN
 plotfunc(SIN(x));
END;
#end

Quote:I can t find the answer in the user guide, so i would like to know how to draw a graph from a programm.
Thanks for your help
Set the cursor on the word plotfunc and press Help, it will help !

CU

Moi aussi je suis en France ! Smile
You should also consider creating your own drawing function (in a standard, not CAS program) using Xmin, Xmax, RECT(), PIXON(), WAIT() ...

Code:

EXPORT MYGRAPH2()
BEGIN
 Xmin:=-8; Xmax:=8;
 Ymin:=-2; Ymax:=2;
 RECT(); // clear screen
 FOR X FROM -8 TO 8 STEP .1 DO
  PIXON(X, SIN(X));
 END;
 WAIT;
END;

Or your program could define one of F1 .. F9 functions, switch to Function app with STARTAPP() and plot view with STARTVIEW() then let the user and the system plot the func and manipulate it.

Programming the Prime is funny and full of options!
Reference URL's