A = [1,2,3;4,5,6;7,8,9];
b = [1;2;3];
c = zeros(3,1);
n = 3;

for i = 1:n
  c(i) = A(i,1)*b(1);
  for j = 2:n
    c(i) = c(i) + A(i,j)*b(j);
  end
end

Ab = A*b
c
