Maple Programming Tips
Where is Help?
Maple has extensive online help build into the program.
You should check the
MSCS Maple Help Page.
There is a reference card for release 5
prepared by Douglas Meade at Univ. of South Carolina
which is very useful. Note this is a postscript file.
Maple Programming Tips
- Reptition while
while condition
do
statements
od;
- Reptition for
for index from start by change to finish
do
statements
od;
- Conditional execution
if condition then
statements1
else
statements2
fi;
- 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 Cover Page