I just started working with MatLab and i cannot resolve this problem: Ax=b is a linear system with A as a matrix 18×18 symmetric 3-diagonal with all the elements equal to 6 on the principal diagonal and equal to 3 on the superior and inferior co-diagonals and b=linspace(5,8,18). You have to calculate eigenvalues of A. Considering the properties of these eigenvalues, solve Ax=b using 2 triangular systems and using the most efficient factorization of A. After that, sum the vector which is the solution of the superior triangular system with the other one (the solution of the inferior triangular system). Do the norm (1) of the result. Sorry for bad English. The correct answer is: 4.4944e+01 . Here is my solution but doesn't work:
A=zeros(18,18)+diag(6*ones(1,18),0)+diag(3*ones(1,17),1)+diag(3*ones(1,17),-1)b=linspace(5,8,18)'eigenv=eig(A)x1=b\triu(A)x2=b\tril(A)x=x1+x2n=norm(x,1)
Best Answer