Why is my condition value different from the answer?

Viewed 39

enter image description here

In a sense I understood the question, the condition number should have been in 2.4ish. But the answer is saying it is different. But I have already done the given correctly when I set up my analysis. Could you please confirm which part is my mistake?

A = 6*eye(18);
B = diag(3*ones(1,17),1);
C = diag(3*ones(1,17),-1);
D = A+B+C;
%here we have the diagonal matrix

val1 = linspace(0,1,18);
val2 = linspace(0,2,18);
val3 = linspace(0,3,18);
q = zeros(18,3);
q(:,1)= val1;
q(:,2) = val2;
q(:,3)= val3;
% here we have the 18x3 matrix
l = zeros(18,3);

for  i = 1:3
    l(:,i)=A\q(:,i);
end
mm =l(:,(1))+l(:,(2))+l(:,(3))
norm(mm,2)
0 Answers
Related