f = (h, r, theta) -> r^2 + h * (1 + cos(theta)); h = 3.5; r = 5; theta = pi / 2; f(h, r, theta)In the interactive mode, if the following command is issued
>> run("testscript.txt"); 28.5 >>All the commands in the script file will be executed as if they were just typed in.