matrice6n

(* prodotto di due matrici *)

matrice1={{2,-4,1},{3,6,-2}};

matrice2={{6,1},{3,-8},{-1,0}};

MatrixForm[matrice1.matrice2]

MatrixForm[{{-1, 34}, {38, -45}}]

;[o]

-1 34

38 -45

MatrixForm[matrice2.matrice1]

MatrixForm[{{15, -18, 4}, {-18, -60, 19}, {-2, 4, -1}}]

;[o]

15 -18 4

-18 -60 19

-2 4 -1

a={{1,2},{-3,4}};

b={{2,5},{6,1}};

MatrixForm[a.b]

MatrixForm[b.a]

MatrixForm[a b]

MatrixForm[{{14, 7}, {18, -11}}]

;[o]

14 7

18 -11

MatrixForm[{{-13, 24}, {3, 16}}]

;[o]

-13 24

3 16

MatrixForm[{{2, 10}, {-18, 4}}]

;[o]

2 10

-18 4

(* prodotto matrice con vettore *)

matrice1={{1,2,3},{4,5,6}};

vettore={2,3};

MatrixForm[matrice1 vettore]

MatrixForm[{{2, 4, 6}, {12, 15, 18}}]

;[o]

2 4 6

12 15 18

(* matrice per costante *)

matrice2={{1,2,3},{4,5,6}};

k=10;

MatrixForm[matrice2 k]

MatrixForm[{{10, 20, 30}, {40, 50, 60}}]

;[o]

10 20 30

40 50 60

(* stampa matrice *)

matrice3={{1,2,3},{4,5,6}};

MatrixForm[matrice3]

TableForm[matrice3]

MatrixForm[{{1, 2, 3}, {4, 5, 6}}]

;[o]

1 2 3

4 5 6

TableForm[{{1, 2, 3}, {4, 5, 6}}]

;[o]

1 2 3

4 5 6

(* crea matrice 2 per 3 *)

(* stampa tabella matrice *)

matrice4=Table[10 (i+j),{i,2},{j,3}]

MatrixForm[matrice4]

TableForm[matrice4]

{{20, 30, 40}, {30, 40, 50}}

;[o]

{{20, 30, 40}, {30, 40, 50}}

MatrixForm[{{20, 30, 40}, {30, 40, 50}}]

;[o]

20 30 40

30 40 50

TableForm[{{20, 30, 40}, {30, 40, 50}}]

;[o]

20 30 40

30 40 50

ritorna a inizio