Question: Please show in matlab Create a symmetric matrix: Create an upper triangular matrix with the following command: A = diag (1: 6) + diag (7:
Create a symmetric matrix: Create an upper triangular matrix with the following command: A = diag (1: 6) + diag (7: 11, 1) + diag (12: 15, 2) Make sure you understand how this command works (see the on-line help on diag). Now use the upper off-diagonal terms of A to make A a symmetric matrix with the following command: A = A + triu (A, 1) This command takes the upper triangular part of A above the main diagonal, flips it (transpose), and adds to the original matrix A, thus creating a symmetric matrix A. Sec the on-line help on triu
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
