I want to sum acidic as the for loop runs and then print out the total value of all the previous acidic values. My problem is right now is it is currently just printing the individual values not one summed value of acidic. How do I sum.
this is what is printing to the command window
ans =
5.9676
ans =
2.1676
here is my code
pki = [7.7,3.9];
t= 2;
n=55;
for i = 1:t;
acidic = log10(1/((n-1)*(10^-pki(i))));
sum(acidic)
end