Order of complexity of a matrix (matlab)

67 Views Asked by At

I need some help answering this question : How do I find the complexity of the matrix B and f knowing that I have this code :

d = 123456; 
randn('state',d); rand('state',d);
n = 1000; A = diag(1+rand(1,n));
k = 5500; r = randperm(n*n,k);
A(r) = A(r) + rand(1,k);
L = tril(A); U = A-L;

x = rand(n,1);
b = A*x;

B = -L\U; f = L\b;

xit = zeros(n,1);
nit = 100;
res = zeros(nit,1);
incr = zeros(nit,1);
err = zeros(nit,1);
for it = 1:nit,
   xit0 = xit;
   xit = B*xit+f;
   res(it) = norm(b-A*xit);
   incr(it) = norm(xit-xit0);
   err(it) = norm(xit-x);
end

Thanks in advance

0

There are 0 best solutions below