Learn MAPLE-SCRIPTING with Real Code Examples
Updated Nov 27, 2025
Code Sample Descriptions
1
Define and Use a Function
f := x -> x^2;
result := f(5);
Define a function to compute the square of a number.
2
Loop Example
fact := 1;
for i from 1 to 5 do
fact := fact * i;
end do;
Compute factorial of a number using a loop.
3
Plot a Function
plot(sin(x), x = 0 .. 2*Pi);
Plot a sine function over a given interval.