triletcops - >> tril(A,1) ans...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Using tril, triu, and diag on a matrix >> A A = 75 75 20 -43 -44 3 -29 -5 92 -36 0 -43 40 24 38 21 -11 54 3 -29 69 -2 -50 6 -5 >> tril(A) ans = 75 0 0 0 0 3 -29 0 0 0 0 -43 40 0 0 21 -11 54 3 0 69 -2 -50 6 -5 >> triu(A) ans = 75 75 20 -43 -44 0 -29 -5 92 -36 0 0 40 24 38 0 0 0 3 -29 0 0 0 0 -5 >> diag(A) ans = 75 -29 40 3 -5 >> diag(diag(A)) ans = 75 0 0 0 0 0 -29 0 0 0 0 0 40 0 0 0 0 0 3 0 0 0 0 0 -5
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: >> tril(A,1) ans = 75 75 0 0 0 3 -29 -5 0 0 0 -43 40 24 0 21 -11 54 3 -29 69 -2 -50 6 -5 >> tril(A,-1) ans = 0 0 0 0 0 3 0 0 0 0 0 -43 0 0 0 21 -11 54 0 0 69 -2 -50 6 0 >> triu(A,1) ans = 0 75 20 -43 -44 0 0 -5 92 -36 0 0 0 24 38 0 0 0 0 -29 0 0 0 0 0 >> triu(A,-1) ans = 75 75 20 -43 -44 3 -29 -5 92 -36 0 -43 40 24 38 0 0 54 3 -29 0 0 0 6 -5 >> Page 1 of 1 10/14/2003 CS/MTH/316/516 triletcops.doc...
View Full Document

Ask a homework question - tutors are online