solving a system of non-linear equations using Fixed point method
이전 댓글 표시
This is my question
Implement the Fixed-point method for solving a system of non-linear equations from scratch in MAT LAB and walk me through your thought process in constructing the code. Additionally, demonstrate that your implementation works by applying it to the following system. x^2 +y^2 +z^2 = 14, x^2−y^2= 2, x +y+z =4.
%ingredients
g = input(' Enter your function ');
x0 = input(' Enter initiak guess '); %x0=0
e = input(' Enter tolerance '); %10^(-4)
n = input(' Enter number of iterations '); %n=20
for i=1:n
x1 = g(x0);
fprintf(' x%d = %.4f\n ' ,i,x1)
if abs (x1-x0)<e
break
end
x0 = x1;
end
This is my code related to this question. Is this correct Please kindly pointout my mistakes...
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Quantization에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!