Learn WOLFRAM-MATHEMATICA-SCRIPTING with Real Code Examples
Updated Nov 27, 2025
Code Sample Descriptions
1
Define and Evaluate a Function
f[x_] := x^2
f[5]
Define a function to compute the square of a number and evaluate it.
2
Loop Example with Table
Table[i^2, {i, 1, 5}]
Compute squares of numbers from 1 to 5 using Table.
3
Plot a Function
Plot[Sin[x], {x, 0, 2*Pi}]
Plot a sine function over the interval 0 to 2Ï€.