iphreeqc = actxserver('IPhreeqcCOM.Object');
iphreeqc.LoadDatabase('C:\Program Files\USGS\IPhreeqcCOM 3.5.0-14000\database\wateq4f.dat');
iphreeqc.RunFile([pwd,'\inputPhreeqC.txt']);
OUTphreeqFILE = iphreeqc.GetSelectedOutputArray
cca=10;
cmg=50;
IPCstringCell= {'SOLUTION 1', ...
'-temp 10', ...
'-units mmol/L', ...
['Ca ', num2str(cca)], ...
['Mg ', num2str(cmg)], ...
'Na 550', ...
'K 10', ...
'Cl 470', ...
'S(6) 28', ...
'C(4) 2.1', ...
'Alkalinity 2.3', ...
'SELECTED_OUTPUT', ...
'-saturation_indices Calcite Dolomite', ...
'-molalities CO2 HCO3-', ...
'soln false', ...
'pH false', ...
'sim false', ...
'state false', ...
'time false', ...
'step false', ...
'pe false', ...
'distance false'};
IPCstring = sprintf('%s\n', IPCstringCell{:})
iphreeqc.RunString( IPCstring );
OUTphreeqSTRING = iphreeqc.GetSelectedOutputArray