I write this simple code in a loop, and I obtain unwabted imaginary results. Could you please tell me where my mistake is: SO = 0.5 .* ones(10,1); A(1,:) = 5.02 * (16.6 / 42) ^ 0.33 * SO(1,:) ^ 0.38; for i = 2 : 10 A(i,:) = 5.02 * ((16.6 - sum(A(1:i-1,:)))/ 42) ^ 0.33 * SO(i,:) ^ 0.38; end
John Williams answered .
2025-11-20
Evaluate the part
((16.6 - sum(A(1:i-1,:)))/ 42)