>> pi:= float(PI); # it's a comment # e:=float(E);
>> read( "file" );On UNIX systems also the pipe mechanism of the shell can be used to start MuPAD with a special command file. This is often used for batch processing and also for demos.
# cat in.mu fact(20); # this is factorial of 20 # quit; # mupad < in.mu >> fact(20); # this is factorial of 20 # 2432902008176640000 &> quit; #
>> x:=42; x:= NIL: x; 42 x
>> loadlib("linalg"): >> M := Matrix(Rational): >> A := M([[1/2,1/3,3/5],[5/7,3,9/2]]); +- -+ | 1/2 , 1/3 , 3/5 | | | | 5/7 , 3 , 9/2 | +- -+ >> N := SquareMatrix(2): >> B := N([[cos(x),sin(x)],[exp(x),ln(x)]]); +- -+ | cos(x) , sin(x) | | | | exp(x) , ln(x) | +- -+