B = cumsum(A)
B =
1 2 3 4 5 6 7 8
2 4 6 8 10 12 14 16
3 6 9 12 15 18 21 24
4 8 12 16 20 24 28 32
5 10 15 20 25 30 35 40
6 12 18 24 30 36 42 48
7 14 21 28 35 42 49 56
8 16 24 32 40 48 56 64
9 18 27 36 45 54 63 72
10 20 30 40 50 60 70 80
11 22 33 44 55 66 77 88
12 24 36 48 60 72 84 96
A
A =
1 2 3 4 5 6 7 8
1 2 3 4 5 6 7 8
1 2 3 4 5 6 7 8
1 2 3 4 5 6 7 8
1 2 3 4 5 6 7 8
1 2 3 4 5 6 7 8
1 2 3 4 5 6 7 8
1 2 3 4 5 6 7 8
1 2 3 4 5 6 7 8
1 2 3 4 5 6 7 8
1 2 3 4 5 6 7 8
1 2 3 4 5 6 7 8
B = (cumsum(A'))'
B =
1 3 6 10 15 21 28 36
1 3 6 10 15 21 28 36
1 3 6 10 15 21 28 36
1 3 6 10 15 21 28 36
1 3 6 10 15 21 28 36
1 3 6 10 15 21 28 36
1 3 6 10 15 21 28 36
1 3 6 10 15 21 28 36
1 3 6 10 15 21 28 36
1 3 6 10 15 21 28 36
1 3 6 10 15 21 28 36
1 3 6 10 15 21 28 36
C = cumsum(B)
C =
1 3 6 10 15 21 28 36
2 6 12 20 30 42 56 72
3 9 18 30 45 63 84 108
4 12 24 40 60 84 112 144
5 15 30 50 75 105 140 180
6 18 36 60 90 126 168 216
7 21 42 70 105 147 196 252
8 24 48 80 120 168 224 288
9 27 54 90 135 189 252 324
10 30 60 100 150 210 280 360
11 33 66 110 165 231 308 396
12 36 72 120 180 252 336 432
A
A =
1 2 3 4 5 6 7 8
1 2 3 4 5 6 7 8
1 2 3 4 5 6 7 8
1 2 3 4 5 6 7 8
1 2 3 4 5 6 7 8
1 2 3 4 5 6 7 8
1 2 3 4 5 6 7 8
1 2 3 4 5 6 7 8
1 2 3 4 5 6 7 8
1 2 3 4 5 6 7 8
1 2 3 4 5 6 7 8
1 2 3 4 5 6 7 8
help eig
EIG Eigenvalues and eigenvectors.
E = EIG(X) is a vector containing the eigenvalues of a square
matrix X.
[V,D] = EIG(X) produces a diagonal matrix D of eigenvalues and a
full matrix V whose columns are the corresponding eigenvectors so
that X*V = V*D.
[V,D] = EIG(X,'nobalance') performs the computation with balancing
disabled, which sometimes gives more accurate results for certain
problems with unusual scaling. If X is symmetric, EIG(X,'nobalance')
is ignored since X is already balanced.
E = EIG(A,B) is a vector containing the generalized eigenvalues
of square matrices A and B.
[V,D] = EIG(A,B) produces a diagonal matrix D of generalized
eigenvalues and a full matrix V whose columns are the
corresponding eigenvectors so that A*V = B*V*D.
EIG(A,B,'chol') is the same as EIG(A,B) for symmetric A and symmetric
positive definite B. It computes the generalized eigenvalues of A and B
using the Cholesky factorization of B.
EIG(A,B,'qz') ignores the symmetry of A and B and uses the QZ algorithm.
In general, the two algorithms return the same result, however using the
QZ algorithm may be more stable for certain problems.
The flag is ignored when A and B are not symmetric.
See also condeig, eigs, ordeig.
Overloaded methods:
lti/eig
sym/eig
Reference page in Help browser
doc eig
eig(C)
??? Error using ==> eig
Matrix must be square.
eig(C'*C)
ans =
1.0e+06 *
-0.0000
-0.0000
-0.0000
-0.0000
0.0000
0.0000
0.0000
1.8798
svd(C)
ans =
1.0e+03 *
1.3711
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
0.0000
diary