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

조회 수: 7 (최근 30일)
James Water Bird
James Water Bird 2022년 6월 7일
편집: James Water Bird 2022년 6월 7일
using this equation
  댓글 수: 2
KSSV
KSSV 2022년 6월 7일
How that equation to be used? What have you attempted?

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

답변 (1개)

Abhijit Nayak
Abhijit Nayak 2022년 6월 7일
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);

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by