
2 Matrices and Arra ys
diagona l, and also changes the sign of the imaginary component of any
complex e lements of the matrix. The dot-apostrophe operator (e.g.,
A.'),
transposes without affecting the sign of complex elements. For matrices
containing all real elements, the two operators return the same result.
So
A'
produces
ans =
16594
310 615
211 714
13 8 12 1
and
sum(A')'
produces a column vector containing the row sums
ans =
34
34
34
34
The sum of the elements on the main diagonal is obtained w ith the sum and
the
diag functions:
diag(A)
produces
ans =
16
10
7
1
2-6
Komentarze do niniejszej Instrukcji