Sponsored links: Algebra eBooks
 

Help Index

A

B

C

D

E

F

G

H

I

J

K

L

M

N

O

P

Q

R

S

T

U

V

W

X

Y

Z

The Maxima on-line user's manual

Algebra Calculator

Search:

Diagmatrix

Function: diagmatrix (<n>, <x>) Returns a diagonal matrix of size <n> by <n> with the diagonal elements all equal to <x>. diagmatrix (<n>, 1) returns an identity matrix (same as ident (<n>)).

M  :  matrix  ([1,  2],  [0,  2]);
B  :  diagmatrix  (2,  3);
B  *  M  /*  Vorsicht:  elementweise  Multiplikation  */;
B  .  M  /*  Matrizenmultiplikation  */;
M  .  2;
M  *  2  /*  Bei  einer  Zahl  ist  es  egal  ob  .  oder  *  */;

<n> must evaluate to an integer, otherwise diagmatrix complains with an error message.

<x> can be any kind of expression, including another matrix. If <x> is a matrix, it is not copied; all diagonal elements refer to the same instance, <x>.

There are also some inexact matches for diagmatrix. Try ?? diagmatrix to see them.

(%o1)                                true
(%i2) 

Related Examples

diagmatrix

a: diagmatrix(10,0);

a[1,1]: 1;

a[2,2]: 1;

Calculate

diagmatrix-display2d-factor-false-matrix-ratsimp-sqrt

display2d: false;

r2: x^2 + y^2;

r: sqrt(r2);

Calculate

diagmatrix

m:diagmatrix(5,1-n);

Calculate

diagmatrix-matrix

x: matrix ([a, a,0,0]...

i: diagmatrix (4, 1);

Calculate

diagmatrix-matrix

x: matrix ([a, a,0,0]...

i: diagmatrix (4, 1);

Calculate

diagmatrix-rank

n : 6;

m:diagmatrix(n,1-n) + 1;

rank(m);

Calculate

diagmatrix-matrix

K : matrix( [1.000,...

W : matrix( [0.316,...

Q : matrix( [0.000,...

Calculate

diagmatrix-expand-jacobian-matrix-phi-ratsimp-sin

A:matrix([0,-1/L1,0],...

B:matrix([1/L1, 0], [...

x:matrix([i_inv],[u_c...

Calculate

diagmatrix-matrix

x: matrix ([6,2,-2], ...

i: diagmatrix (3, a);

Calculate

diagmatrix-expand-jacobian-matrix-phi-sin

A:matrix([0,-1/L1,0],...

B:matrix([1/L1, 0], [...

x:matrix([i_inv],[u_c...

Calculate