Hi Eddy,
It is because in one of the for loop, you made sum as a variable too. Using the same variable which is the same as inbuilt function is not encouraged and lead to inappropriate conditions as such.
So, update this loop here and this should solve:
for i=na:-1:1
sumOut=0;
X(i)=0;
for j=1:na
sumOut=sumOut+A(i,j)*X(j);
end
X(i)=(B(i)-sumOut)/A(i,i);
end
Hope this helps.
Regards,
Sriram
Best Answer