
nsize = 3235;
A = rand(nsize);
b = rand(nsize,1);
c = zeros(nsize,1);

tic;

for i = 1: nsize                    % outer loop
    A(i,i) = A(i,i) - sum(sum(A));  % modify the diagonal matrix elements
for j = 1: nsize                    % inner loop
    c(i,1) = c(i,1) + A(i,j)*b(j,1);
end
end

toc;
