I am trying to run this:
N=[26, 40.4, 49.6, 56.4, 62.1, 67.4, 72.4, 77.3, 82.2, 87.2, 92.5, 98.1, 104, 110.8, 118.5, 125.5, 138.5, 153, 178.8, 210.6];
M=0.000001*N
A=[3596.212, 270.068; 7907.681, -12159.460; 13585.443, -4913.489; 15361.970, -21745.037]
X=(M.*(6.023e+23))./((M.*(6.023e+23))+(7.122*(1.0e+19)))
for j=0:7
S=S+(A(j).*((2.*X-1).^j))
break
end
s=sum(S)
DGex=(X.*(1-X)).*s
TE=8.314.*304.15.*((X.*log(X))+((1-X).*log(1-X)))
DGM=DGex+TE
But the output is:
??? Attempted to access A(0); index must be a positive integer or logical.
Error in ==> essai2 at 14
S=S+(A(j).*((2.*X-1).^j))
|