how do i write a scrip for finding the loop of sin figures
7 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
using this equation
2 commentaires
Dyuman Joshi
le 7 Juin 2022
If you need help starting, refer to - Babylonian Method of computing Square Root
Réponses (1)
Abhijit Nayak
le 7 Juin 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);
0 commentaires
Voir également
Catégories
En savoir plus sur Matrix Indexing dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!