Maple Programming Tips

Where is Help?
Maple has extensive online help build into the program which can be found using:

There are also documents in /LocalLibrary/MapleDocs for the machines in room 200 SEO. The quick tips is a useful starting document.

Maple Programming Tips

  1. Reptition while

    while condition

    do

    statements

    od;


  2. Reptition for for index from start by change to finish

    do

    statements

    od;


  3. Conditional execution if condition then

    statements1

    else

    statements2

    fi;


  4. Maple procedures

    proc(arguments)

    expressions and statements

    end

Here is a sloppy example of Horner's method programmed in Maple. I was lazy and inserted a list named a which the coefficients of the polynomial directly in the procedure. The usage is: h(x)

h := proc(x)
local y, a, i;
Digits:= 6; 

a := [1.0,-8.0,28.0,-56.0,70.0,-56.0,28.0,-8.0,1.0]; y:= 0; for i from 1 to 9 do y := y*x+a[i]; od; end;

Back to Maple assignments