Iteration for String (Crossed) method

조회 수: 1(최근 30일)
Deividas David
Deividas David 2021년 11월 21일
댓글: Rik 2021년 11월 21일
Hello, I currently have written code for Newton method. However, I need to change it to String or also known as Crossed method and I have no idea how to do that. My current one is below:
x0 = a; dx = eps;
atlikta = 0;
while ~atlikta
x = x0;
f0 = eval(f);
x = x + dx;
fd = eval(f);
df = (fd - f0) / dx;
x1 = x0 - f0 / df;
if abs(x1 - x0) < eps
atlikta = 1;
else
x0 = x1;
end
spr = x1;
end
  댓글 수: 1
Rik
Rik 2021년 11월 21일
Even in Octave you shouldn't need eval here.
Also, this is completely undocumented code, and you don't explain what changes you want to make. It sounds to me like you need to implement an entirely different algorithm, but you don't explain the differences, nor what you have tried.

댓글을 달려면 로그인하십시오.

답변(0개)

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by