C0=[0.1:0.1:4.02];for i=1:length(C0)%Creation of the ActiveX server:iphreeqc = actxserver('IPhreeqcCOM.Object');%Specify the database file according to the location on your file system.iphreeqc.LoadDatabase([pwd,'\pitzer.dat']);%Please change this line if you installed this somewhere else%Call PhreeqC functionality using separate input file%Note that in this way dynamic assignment of values to variables is not possible.%I assume that the input file for PhreeqC is located in the current working directory.%iphreeqc.RunFile([pwd,'\inputPhreeqC.txt']);OUTphreeqFILE = iphreeqc.GetSelectedOutputArray;%Call PhreeqC functionality providing input as MATLAB multiline String%Define input string as cell array of strings and combine them to a multiline string using the sprintf command.mS =C0(i);tem=20;IPCstringCell= {'SOLUTION 1', ... ['temp ' num2str(tem)],... '-pH 1 charge',... '-units mol/kgw ', ... ['S(6) ' num2str(mS)],... 'SAVE SOLUTION 1', ... 'SELECTED_OUTPUT', ... '-molalities H+ HSO4- SO4-2', ... 'soln false', ... 'pH false', ... 'sim false', ... 'state false', ... 'time false', ... 'step false', ... 'pe false', ... 'distance false' ... };IPCstring = sprintf('%s\n', IPCstringCell{:})%Use the PhreeqC object method RunString with the above defined multiline string.iphreeqc.RunString( IPCstring );OUTphreeqSTRING = iphreeqc.GetSelectedOutputArrayout1=OUTphreeqSTRING(2,:);m_H_25(i)=out1{1};m_HSO4_25(i)=out1{2};m_SO4_25(i)=out1{3};end