Using a while loop to output a cube root?

조회 수: 3 (최근 30일)
Nick Haufler
Nick Haufler 2015년 10월 8일
답변: TastyPastry 2015년 10월 8일
In the attached document, I cant seem to get the actual cube root value to come out. Could someone please look at my script file.

답변 (1개)

TastyPastry
TastyPastry 2015년 10월 8일
You're not updating the estimate. Your function's loop repeatedly uses the user inputted value for intialEstimate rather than updating it as the calculation progresses. You need to fix line 6 so that the estimate is updated for each loop iteration.

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by