Square root algorithm of a positive number

3 ビュー (過去 30 日間)
Shamala Nagarajoo
Shamala Nagarajoo 2017 年 12 月 11 日
回答済み: Jan 2017 年 12 月 11 日
  1 件のコメント
Adam
Adam 2017 年 12 月 11 日
What about it?

サインインしてコメントする。

回答 (1 件)

Jan
Jan 2017 年 12 月 11 日
As usual for homework questions: Please post, what you have tried so far and ask a specific question. It would be counter-productive if a solution is posted here, because submitting it would be cheating. But if you post a piece of code -even if it is not running- and ask a specific question about it, answers would assist you only, and this is fair and legal - a kind of expanded documentation.
Note that you do not need to define x(n), but this is simple the value of A. Instead of "y(n)" and "y(n-1)" you can simply use "S = 0.5 * (S + A/S)". You need a while loop, which stops, when the value of S does not change remarkably anymore.

カテゴリ

Help Center および File ExchangeMATLAB についてさらに検索

Translated by