Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
112 views

Welcome To Maple 8: "Command The Brilliance of A Thousand Mathematicians."

1. Maple is a mathematical software that allows users to perform algebraic calculations and manipulations through the use of commands. Commands must end with a semicolon or colon, with the colon suppressing output. 2. Special commands in Maple allow users to work with complex numbers, trigonometric functions, and other advanced mathematical objects. The command "evalf" evaluates expressions numerically, "I" represents the imaginary unit sqrt(-1), and "Re" and "Im" extract the real and imaginary parts of a complex number. 3. The "Mobius" function defined represents a Möbius transformation. Through the use of assumptions and substitution, Maple can simplify expressions and extract
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
112 views

Welcome To Maple 8: "Command The Brilliance of A Thousand Mathematicians."

1. Maple is a mathematical software that allows users to perform algebraic calculations and manipulations through the use of commands. Commands must end with a semicolon or colon, with the colon suppressing output. 2. Special commands in Maple allow users to work with complex numbers, trigonometric functions, and other advanced mathematical objects. The command "evalf" evaluates expressions numerically, "I" represents the imaginary unit sqrt(-1), and "Re" and "Im" extract the real and imaginary parts of a complex number. 3. The "Mobius" function defined represents a Möbius transformation. Through the use of assumptions and substitution, Maple can simplify expressions and extract
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 26

>

Welcome to Maple 8
"Command the Brilliance of a Thousand Mathematicians."
[sic]
Care of Adam Bowers, just one mediocre mind.
>

Basic Commands
All Maple commands must end with either a semicolon ( ; ) or a colon ( : ). The difference between the two
is that the colon suppresses output.
> a:=5;
a := 5

> b:=-6:
When assigning values to a name, you must use a
:=
Otherwise, no assignment is made.
> c=13;
c = 13

You can view what is assigned to a name at any time.


> a;
5

> b;
-6

> c;
c

The basic algebraic operators are what you might expect: +, -, *, and /.
> a+b; a-b; a*b; a/b;
-1
11
-30
-5
6

You need not assign values to a name to work with it.


> a*c+z;
5c+z

If you want to use a new value for a name, just go ahead and assign something new:
> a:=14570;
a := 14570

> a;b;c;
14570
-6
c

You can also unassign names, so they have no specified value:


> unassign('a');
> a;
a

>
> b:=evaln(b);
b := b

That command assigns the name of a name, not the value


> b;
b

>
You can also assign functional values.
> f:=x^2-1;
2
f := x - 1

> g:=x+1;
g := x + 1

> h:=1/x;
1
h :=
x

> f+g;
2
x +x

Try the factor command.


> factor(f+g);
x (x + 1)

Maple is case sensitive.


> F:=(f+g)*h;
2
x +x
F :=
x

> F;
2
x +x
x

> f;
2
x -1

> F/f;
2
x +x
2
x (x - 1)

If an expression can be simplified, use the command simplify to do so.


> simplify(F);
x+1

> expand(F/f);
x 1
+
2 2
x -1 x -1

> simplify(F/f);
1
x-1

Now let's try something more complicated.


>
> h:=sin(x*y)/x;
sin(x y)
h :=
x

> Mobius:=(a*z+b)/(c*z+d);
az+b
Mobius :=
cz+d

A name in Maple need not be only one letter.


>
So what if I want to know what a function is at a certain domain value? How do we find, say, f(3)?
Well, we just substitute the value 3 in place of x.
> f;
2
x -1
> f(3);
2
x(3) - 1

Well, that's not going to work, we have to tell Maple very explicitly what to do.
> subs(x=3,f);
8

Here we substituted x=3 into the function f.


>
> subs(z=0,Mobius);
b
d

> subs(z=1-I,Mobius);
(1 - I) a + b
(1 - I) c + d

Oh wait ... what was that "I" thing? You probably can guess that I = -1 . That brings up a good point,
let's talk about some ...
>
>

Special Commands and Characters


>
>

Want some Pi?


>
The command for pi=3.1415... is
> Pi;
π

> evalf(Pi);
3.141592654

Wait a minute? What command was that? If you don't know a command, you open the help
documentation by typing a question mark and then the command.

> ? evalf
>
>
>

Complex numbers are nIce,


but remember that
-1 = I
>
Use a capitol "I" for an imaginary number, not a lower case "i".
> I^2;
-1

> x+I*y;
x+yI

So how do you do square roots, anyway?


> sqrt(-1);
I

> sqrt(-4*x);
2 -x

Why didn't it pull out the I? Maybe x<0, Maple can't distinguish, unless we tell it in advance.
> assume(x>0);
> sqrt(-4*x);
2I x~

The ~ that appears after the x is Maple's way of letting us know it's assuming something about x. Let's
make it forget that assumption.
> unassign('x');
> x;
x

Good, there is no ~ after the x, so Maple doesn't think it's positive anymore.
>
Maple can also tell us the real and imaginary parts of a complex number.
> w:=5-I*3;
w := 5 - 3 I

> Re(w);
5

> Im(w);
-3
> Re((3-4*1)/(2+3*I));
-2
13

> Im((3-4*1)/(2+3*I));
3
13

>
Let's get back to our Mobius function.
> Mobius;
az+b
cz+d

> Mo1:=simplify(subs(z=1-I,Mobius));
-a + a I - b
Mo1 :=
-c + c I - d

> Re(Mo1);
æ -a + a I - b ö
Âç ÷
è -c + c I - d ø

Maple cannot tell if a,b,c,d are real or imaginary, so it cannot give us the real part.
> assume(a,real);assume(b,real),assume(c,real),assume(d,real);
> Re(Mo1);
2 a~ c~ + a~ d~ + b~ c~ + b~ d~
2 2
2 c~ + 2 c~ d~ + d~

> Im(Mo1);
-b~ c~ + a~ d~
-
2 2
2 c~ + 2 c~ d~ + d~

Actually we could have made those assumptions at the same time:


> assume(a,real,b,real,c,real,d,real);
We can also check to see if those assumptions actually worked using the is command.
> is(a,real);
true

> is(b,integer);
false

Maple said b was not an integer, because we never made that assumption.
> additionally(b,integer);
> is(b,integer);
true

For more assumption commands, type ? assume


> ? assume
Just to be safe, I'll remove all of my assumptions by assigning names to a,b,c, and d.
> a:='a'; b:='b'; c:='c'; d:='d';
a := a
b := b
c := c
d := d

> is(a,real);
false

> is(b,integer);
false

>
>

Trigonometry is a Pythagorean's best friend


>
The three main trig functions are:
> sin(x);
sin(x)

> cos(x);
cos(x)

> tan(x);
tan (x)

To evaluate on numbers, just type them in:


> sin(0);
0

> cos(Pi);
-1

> sin(Pi/4);
2
2
> tan(Pi/2);
Error, (in tan) numeric exception: division by zero

Oops, I just tried to divide by zero. Whenever I try to do something Maple can't do, it'll let me know.
Although the error message might be unintelligible.
>
And all of our other favorites are here, too.
> sin(x)*csc(x);
sin(x) csc(x)

Oops, that didn't work. Let's simplify, but I don't want to type the whole thing again, so I'll use
%
which will input whatever was last output.
> simplify(%);
1

> simplify(1/sec(x));
cos(x)

> simplify((sin(x)/cos(x)*cot(x));
Error, `;` unexpected

Oops, I forgot to close up my parentheses, let me try that again.


> simplify((sin(x)/cos(x))*cot(x));
1

>
The inverse functions just have "arc" written in front of them:
> sin(arcsin(5));
5

> arcsin(sin(5));
5-2π

> cos(arccos(x));
x

> arccos(cos(x));
arccos(cos(x))

> arccos(cos(Pi));
π

>
Maple is pretty good with trig identities, too.
> (sin(x))^2+(cos(x)^2);
2 2
sin(x) + cos(x)

> simplify(%);
1

Note that the ^2 was after the sin(x) and cos(x), not in the middle.
>
> tf:=sin(x+y);
tf := sin(x + y)

> expand(tf);
sin(x) cos(y) + cos(x) sin(y)

> combine(%,trig);
sin(x + y)

For more information on how to use trig commands, just type


> ? trig
>
>

It's very natural


Using exp and log
>
If you want to find an exponential, you have to use the exp command.
> exp(x);
x
e

> exp(-1);
(-1)
e

> exp(Pi*I)+1;
0

> exp(ln(2));
2

The command ln is the natural log command, but you can use log, too.
> exp(log(2));
2
>
>
>
>
>

Solving Equations
To solve equations for unknowns, simply use the solve command.
> solve(x^2-1=3,x);
2, -2

To put the solutions into a set, put the equations or unknowns in a set.
> solve({x^2-1=3},x);solve(x^2-1=3,{x});
{x = 2}, {x = -2}
{x = 2}, {x = -2}

If you want to solve for 0, you don't need the equals sign:
> solve(x^2-4=0,x); solve(x^2-4,x);
2, -2
2, -2

You can also solve a system of equations for several unknowns, but be sure to put all of the equations into a
set, as well as the unknowns.
> solve({x^2-4,x-2},{x});
{x = 2}

> solve({x+3*y-1, y-3},{x,y});


{x = -8, y = 3}

> solve({x+y+z,3*x-2*y},{x,y,z});
ì 5x 3 xü
í x = x, z = - ,y= ý
î 2 2 þ

In this system, one of the unknowns is a free parameter, Maple chose it to be x. You can see that y and z are
solved in terms of x.
In the above family of solutions, if you would rather have the unknowns in terms of z, you can just leave it
out of the list of unknowns.
> solve({x+y+z,3*x-2*y},{x,y});
ì 2z 3 zü
í x=- ,y=- ý
î 5 5 þ

Of course, not all systems of equations have a solution.


> solve({x-1,x-4},{x});
In this case, I was given no output, to signal that there was no solution.
>
>
>

Matrix Manipulation
One of the things I use Maple for most often is to solve linear algebra problems.
There are several ways to define a matrix:
> M:=matrix([[-2,0],[3,1]]);
é -2 0ù
M := ê ú
ê 3 1úû
ë

> N:=matrix(2,3,[1,2,3,4,5,6]);
é 1 2 3ù
N := ê ú
ê 4 5 6úû
ë

I wonder what the product of those matrices are...


> evalm(M &* N);
é -2 -4 -6ù
ê ú
ê 7 11 15úû
ë

Okay, so what happened there? The command evalm tells Maple I am about to evaluate something with
matrices, and whenever that operation is matrix multiplication, I do &* so Maple knows a matrix is being
multiplied by another matrix and not a scalar.
>
> A:=matrix(2,2,1);
é 1 1ù
A := ê ú
ê 1 1úû
ë

That's a 2x2 matrix with all entries 1.


> B:=matrix([[cos(x),sin(x)],[-sin(x),cos(x)]]);
é cos(x) sin(x) ù
B := ê ú
ê -sin(x) cos ( x) ú
ë û

> C:=evalm(3*A-B);
é 3 - cos(x) 3 - sin(x) ù
C := ê ú
ê 3 + sin(x) 3 - cos(x)úû
ë

I have just decided I am only interested in the case x=Pi/2, so why don't I substitute in the value? I have to
remember that Maple has a hard time knowing matrix commands from scalar commands, so I need to use the
map2 command. This command will map the command subs into each matrix entry.
> BB:=map2(subs,x=Pi/2,B);
é æ πö æ πö ù
ê cosç ÷ sinç ÷ ú
ê è 2ø è 2ø ú
BB := ê ú
ê ú
ê -sinæ π ö æ πö ú
cosç ÷ ú
ê ç ÷
ë è 2ø è 2ø û

> simplify(BB);
é 0 1ù
ê ú
ê -1 0úû
ë

> C:=simplify(evalm(3*A-BB));
é 3 2ù
C := ê ú
ê 4 3úû
ë

So now I have a matrix. Let's say I really like looking at entries in the 2nd row 1st column. I can get it all by
itself using the following command:
> C[2,1];
4

I put the name of the matrix, followed by a list containing the row and column numbers:
MatrixName[RowNumber,ColumnNumber].
> C[1,2];
2

> C[1,1]-C[2,2];
0

> 1002*C[2,1]+999*C[1,2];
6006

> C[3,2];
Error, 1st index, 3, larger than upper array bound 2

There is no third row in my matrix C, so I didn't have a entry for C[3,2].


>
If I want to do anything more interesting, I'll have to use the PACKAGE made for linear algebra, called
linalg.
> with(linalg);
Warning, the protected names norm and trace have been redefined and unprotected

[BlockDiagonal, GramSchmidt, JordanBlock, LUdecomp, QRdecomp, Wronskian, addcol, addrow, adj,


adjoint, angle, augment, backsub, band, basis, bezout, blockmatrix, charmat, charpoly, cholesky, col,
coldim, colspace, colspan, companion, concat, cond, copyinto, crossprod, curl, definite, delcols,
delrows, det, diag, diverge, dotprod, eigenvals , eigenvalues , eigenvectors , eigenvects , entermatrix,
equal, exponential, extend, ffgausselim, fibonacci, forwardsub, frobenius, gausselim, gaussjord,
geneqns, genmatrix, grad, hadamard, hermite, hessian, hilbert, htranspose, ihermite, indexfunc,
innerprod, intbasis, inverse, ismith, issimilar, iszero, jacobian, jordan, kernel, laplacian, leastsqrs,
linsolve, matadd, matrix, minor, minpoly, mulcol, mulrow, multiply, norm, normalize, nullspace,
orthog, permanent, pivot, potential, randmatrix, randvector , rank, ratform, row, rowdim, rowspace,
rowspan, rref, scalarmul, singularvals , smith, stackmatrix, submatrix, subvector , sumbasis, swapcol,
swaprow, sylvester , toeplitz, trace, transpose, vandermonde, vecpotent, vectdim , vector , wronskian]

The command with tells Maple to open up one of the predefined packages, in this case the linalg package. If
you choose not to suppress the output with a colon, it lists all commands in the package. (For now, you can
just ignore any warnings of "redefined and unprotected".)
>
Now we can take an inverse, or find a transpose.
> C;
C

> op(C);
é 3 2ù
ê ú
ê 4 3úû
ë

The op command, among other things, shows the matrix instead of just the name.
> det(C);
1

> Cinv:=inverse(C);
é 3 -2ù
Cinv := ê ú
ê -4 3úû
ë

> Ctrans:=transpose(C);
é 3 4ù
Ctrans := ê ú
ê 2 3úû
ë

> evalm(C &* Cinv);


é 1 0ù
ê ú
ê 0 1úû
ë

> A:=diag(a,b,c);
é a 0 0ù
ê ú
A := ê 0 b 0ú
ê ú
ê ú
ë 0 0 cû

> X:=diag(x,y,z);
é x 0 0ù
ê ú
X := ê 0 y 0ú
ê ú
ê ú
ë 0 0 zû

> evalm(A &* X);


é ax 0 0ù
ê ú
ê 0 by 0ú
ê ú
ê ú
ë 0 0 c zû

You can do some nifty things with linalg. For example, using the linsolve command, you can find which
matrix will get you from one to another.
> phil:=randmatrix(3,3);
é -85 -55 -37ù
ê ú
phil := ê -35 97 50ú
ê ú
ê ú
ë 79 56 49û

> george:=randmatrix(3,3);
é 63 57 -59ù
ê ú
george := ê 45 -8 -93ú
ê ú
ê ú
ë 92 43 -62û

(randmatrix gives a random matrix of specified dimensions.)


> martha:=linsolve(phil,george);
é -228262 -142414 225184 ù
ê ú
ê 121529 121529 121529 ú
ê ú
ê -811145 -571276 562519 úú
martha := ê
ê 121529 121529 121529 ú
ê ú
ê ú
ê 1523214 989141 -1159702 ú
ê 121529 121529 121529 úû
ë

So martha should take us from phil to george.


> evalm(phil &* martha);
é 63 57 -59ù
ê ú
ê 45 -8 -93ú
ê ú
ê ú
ë 92 43 -62û

If you didn't trust your matrix reading ability, then you could check by subtraction.
> evalm(phil &* martha - george);
é 0 0 0ù
ê ú
ê 0 0 0ú
ê ú
ê ú
ë 0 0 0û

Now let's try something involving unknown quantities.


> M:=matrix([[2,8],[-1,-4]]);
é 2 8ù
M := ê ú
ê -1 -4úû
ë

> N:=matrix([[a,b],[c,d]]);
é a bù
N := ê ú
ê c dúû
ë

I want M &* N to be the zero matrix.


> MN:=evalm(M &* N);
é 2a+8c 2 b + 8 dù
MN := ê ú
ê -a - 4 c -b - 4 d úû
ë

Let's list the entries in a set:


> eqs:={MN[1,1],MN[1,2],MN[2,1],MN[2,2]};
eqs := {2 a + 8 c, 2 b + 8 d, -a - 4 c, -b - 4 d}

Now we solve.
> sols:=solve(eqs,{a,b,c,d});
sols := {c = c, d = d, b = -4 d, a = -4 c}

So any matrix of the form a=-4c and b=-4d will suffice. We can substitute these values into out matrix, but
remember to use the map2 command, otherwise Maple might get confused.
> newN:=map2(subs,sols,N);
é -4 c -4 dù
newN := ê ú
ê c d úû
ë

This is just the tip of the linalg iceberg. For more information, just type ?linalg
>
>
>
>
>

Plots in 2 and 3 Dimensions


If you want to graph a function (for example, the function y=1/x), use the plot command...
> plot(1/x);
Plotting error, empty plot

... but you'll have to enter a domain. Be sure to separate the endpoints of the domain with two periods (as in
"..").
> plot(1/x,x=-5..5);
500

400

300

200

100

0
-4 -2 0 2 4
x

-100

-200

Ouch! That's not very useful. Try specifying a range ...


> plot(1/x,x=-5..5,y=-5..5);
4

y
2

0
-4 -2 0 2 4
x

-2

-4

Yeah, that's much better. Let's try something in three dimensions, but now we have to use plot3d.
> plot3d(sin(x*y)/(x*y),x=-2..2,y=-2..2);
If you want, you can move it around by clicking on it and dragging your pointer around. If you right click,
you can change colors, export as an eps file, and many other things.
For more advanced plotting, you should try the plots package. The plots command inequal will allow you
graph sets of inequalities. For more info, just type ?plots
> ? plots
>
>
>
>
>
Segregation is Bad, but Differentiation is Good.
Differentiation is quite straightforward. Just use the diff command on your function, remembering to tell
Maple which variable with which to differentiate.
Let's differentiate the function
> f:=x^3+2*x^2-4*x+1;
3 2
f := x + 2 x - 4 x + 1

> diff(f,x);
2
3x +4x-4

If we want a second derivative, just nest the diff commands.


> diff(diff(f,x),x);
6x+4

> diff(%,x);
6

And that was a third derivative.


Let's do something a bit more interesting.
> g:=(sin(x))^2+tan(x)+exp(y);
2 y
g := sin(x) + tan (x) + e

> diff(g,x);
2
2 sin(x) cos(x) + 1 + tan (x)

> diff(g,y);
y
e

> diff(diff(g,x),x);
2 2 2
2 cos(x) - 2 sin(x) + 2 tan (x) (1 + tan (x) )

> diff(diff(g,y),y);
y
e

> diff(diff(g,x),y);
0

Two more examples.


> diff(sin(x*y)/x,y);
cos(x y)

> diff(log(x)/x,x);
1 ln(x)
-
2 2
x x

>
>
>
>

Integration
Integration is done much like differentiation, but the command is int.
> f:=x^3+x^2+x+1;
3 2
f := x + x + x + 1

> int(f,x);
1 4 1 3 1 2
x + x + x +x
4 3 2

the diff and int commands can work together.


> diff(int(f,x),x);
3 2
x +x +x+1

> int(diff(f,x),x);
3 2
x +x +x

Notice that there is no constant of integration.


You can also do definite integrals (don't forget the "..").
> int(f,x=0..2);
32
3

> int(sin(x),x=0..Pi);
2

A function might be discontinuous, but you can tell Maple to overlook that problem.
> int(1/x,x=-10..10);
undefined

> int(1/x,x=-10..10,'continuous');
-I π

>
>
Some functions might be hard to integrate, so Maple might give you something like this:
> h:=exp(-x^2)*log(x);
(-x 2)
h := e ln(x)

> int(h,x);
ó 2
ô e (-x ) ln(x)
ô dx
ô
õ

But don't give up, some things can still be done.


> int(h,x=0..infinity);
π γ 1
- - ln(2) π
4 2

One more example:


> P:=r*cos(theta)*sin(phi);
P := r cos(θ) sin(φ )

> P1:=int(P,phi=0..Pi/2);
P1 := r cos(θ)

> P2:=int(P1,theta=0..Pi/4);
2 r
P2 :=
2

> P3:=int(P2,r=0..2);
P3 := 2

Of course, you could do it all in one go:


> int(int(int(r*cos(theta)*sin(phi),phi=0..Pi/2),theta=0..Pi/4),r=0..2);
2

For more, just type ?int at the prompt.


>
>

If-Then, For-Do, and other ways to get confused.


>
> lantern:=1;
lantern := 1

> if lantern=1 then print(`By land`) fi;


By land

When writing an if-then command, the syntax is

if [condition] then [result] fi;

For every if, you must have an opposing fi.


(Note that any text in the print command must be inside `single quotes`, not 'single quotes'.)
>
> a:=3;b:=4;
a := 3
b := 4

> if a<b then print(`less than`) fi;


less than

But the condition might not be satisfied.


> if a>=b then print(`greater than or equal to`) fi;
In cases where this might happen, you can use the else command.
>
> if a>=b then print(`greater than or equal to`) else
print(`less than`);
fi;
less than

In this example, I used more than one line, but that's okay, as long as I remember to put semi-colons (or
colons) in all but the first line.
In the previous example, I used shift-enter to make a blank line below the prompt.
>
> if lantern=1 then print(`By land`) else
print(`By sea`);
fi;
By land

> lantern:=2;
lantern := 2

> if lantern=1 then print(`By land`) else


print(`By sea`);
fi;
By sea

This might not be exactly what you want, because any value for lantern other than 1 will give `By sea`. How
do we solve this problem? By making our program longer, of course.
> lantern:=3;
lantern := 3

> if lantern=1 then print(`By land`) else


if lantern=2 then print(`By sea`) else
print(`I said ONE if by land, TWO if by sea. There are no other
choices!`);
fi;
fi;
I said ONE if by land, TWO if by sea. There are no other choices!

>
Usually, if-than commands are not used on there own. Usually, they are used inside of other structures, like
a for-do command.
> for i from 1 to 3 do print(i) od;
1
2
3

When writing a for-do command, the syntax is

for [index] from [starting value] to [finishing value] do [expression] od;

For every do, you must have a opposing od.

>
The for-do commands make it much easier to do repeated calculations.
> for i from 1 to 3 do i^5 od;
1
32
243

> for k from 9997 to 9999 do 1/k+k/3-k^2 od;


-2997200869907
29991
-2998100399969
29994
-999666703331
9999

We can put if-then commands inside of for-do loops.


> lantern:='lantern';
lantern := lantern

Now I have made sure that the name "lantern" has no value assigned to it.
> for lantern from 1 to 3 do
if lantern=1 then print(lantern,`By land`) fi;
if lantern=2 then print(lantern,`By sea`) fi;
if lantern>2 then print(lantern,`Are you smoking on the job, Henry?`)
fi;
od;
1, By land
2, By sea
3, Are you smoking on the job, Henry?

A few simple examples:


> for j to 6 do x||j:=j od;
x1 := 1
x2 := 2
x3 := 3
x4 := 4
x5 := 5
x6 := 6

> for m to 6 do
if is(x||m,even) then print(`even`) else print(`odd`) fi;
od;
odd
even
odd
even
odd
even

> for number from 4 to 6 do


y||(number-3):=x||number;
od;
y1 := 4
y2 := 5
y3 := 6

Now something a bit trickier.


> M1:=matrix([[0,1,3],[-1,-1,3],[0,1,0]]);
é 0 1 3ù
ê ú
M1 := ê -1 -1 3ú
ê ú
ê ú
ë 0 1 0û

> M2:=matrix([[2,2,-2],[0,-4,4],[2,1,4]]);
é 2 2 -2ù
ê ú
M2 := ê 0 -4 4ú
ê ú
ê ú
ë 2 1 4û

> M3:=matrix([[1,1,1],[2,2,2],[3,3,Pi]]);
é 1 1 1ù
ê ú
M3 := ê 2 2 2ú
ê ú
ê ú
ë 3 3 πû

> for i to 3 do
linalg[det](M||i);
od;
-3
-40
0

> for i to 3 do
for j to 3 do
if M3[i,j]=Pi then print(M3[i,j],`huh?`) fi
od;
od;
π, huh?

>
For loops can get really complicated. Usually they are planted in programs, but that is a topic for another
time. For more information just type ?for
> ?for
Go on ... do it ... you know you want to ...
>
>

You might also like