c1 = 0.1;c2 = 0.0001;L = 5.0;M = 0.04;P1 = 1.0e-2;P2 = 1.0e-5;for i=1:64for j=1:64C1(i,j) = c1 + P1*(0.5-rand);C2(i,j) = c2 + P2*(0.5-rand);endendfor i=1:64 for j=1:64 dfdC1(i,j) = (L/M) - M*(log(1 - C1(i,j) - C2(i,j)) - log(C1(i,j)))/M; endend
MATLAB: My code is generating this error ” Index exceeds matrix dimensions” . Apparently it looks fine. Still can not figure out the problem.
computational engineeringmaterials sciencemathematical modeling
Best Answer