asd
asd

Reputation: 337

How to define determinant of a matrix as a function in mathematica?

Let

A(t)=(f1(t), f2(t); f3(t), f4(t)) be a 2*2 matrix

first of all how can I define the matrix A(t) as a function of t

then

I would like to define the determinant of A as a function, i.e.

d(t)=Det(A(t))

and then plot d(t).

Actually I want to write this function for n*n matrix where n>=2

thanks

Upvotes: 2

Views: 2035

Answers (1)

Dr. belisarius
Dr. belisarius

Reputation: 61026

For example:

a[t_] := Table[Sin[(n + m) t], {n, 2}, {m, 2}]
d[t_] := Det[a[t]]
Plot[d[t], {t, 0, 2 Pi}]

enter image description here

If you don't have an explicit expression:

a[t_]:= {{f1[t],f2[t]},{f3[t],f4[t]}}

also works

Edit

Using the dimension as a parameter:

a[t_, n_] := Table[1/(j + k) t, {j, n}, {k, n}]
d[t_, n_] := Det[a[t, n]]
Plot[d[t, 5], {t, 0, 2 Pi}]

enter image description here

Edit

Plotting several dimensions in the same plot:

a[t_, n_] := Table[k^4/(j + k) t, {j, n}, {k, n}]
d[t_, n_] := Det[a[t, n]]
Plot[Evaluate@Table[d[t, n], {n, 2, 5}], {t, 0, 20}]

enter image description here

Upvotes: 4

Related Questions