Using a while loop to output a cube root?
1 次查看(过去 30 天)
显示 更早的评论
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.
0 个评论
回答(1 个)
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.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Loops and Conditional Statements 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!