Filter löschen
Filter löschen

how do i write a scrip for finding the loop of sin figures

1 Ansicht (letzte 30 Tage)
James Water Bird
James Water Bird am 7 Jun. 2022
Bearbeitet: James Water Bird am 7 Jun. 2022
using this equation

Antworten (1)

Abhijit Nayak
Abhijit Nayak am 7 Jun. 2022
This is a method of finding square-root of a number using Babylonian Method.
The following code is for your required significant figures which you can change according to your need.
x=15;
xn=x./2;
err=abs(xn-x./xn);
while any(err>1e-4)
xn=0.5.*(xn+x./xn);
err=abs(xn-x./xn);
end
y=xn;
fprintf("the ans is %.4f",y);

Kategorien

Mehr zu Mathematics finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by