필터 지우기
필터 지우기

Display actual and estimate values of cube root?

조회 수: 4 (최근 30일)
Nick Haufler
Nick Haufler 2015년 10월 10일
댓글: Walter Roberson 2015년 10월 10일
In the attached document, my actual value of the cube root and also my estimated value come out the same. Can someone please take a look at my script?

채택된 답변

Walter Roberson
Walter Roberson 2015년 10월 10일
Look at your code:
fprintf('The actual cube root is %0.3f\n', Estimate)
fprintf('The estimate of the cube root is %0.3f\n', Estimate)
You are printing the same value twice. You never calculate the "actual" cube root.
Even if you did calculate the actual cube root, would you be able to see the difference within the 3 decimal places that you print out?
  댓글 수: 2
Nick Haufler
Nick Haufler 2015년 10월 10일
So the two values would be the same
Walter Roberson
Walter Roberson 2015년 10월 10일
No. Try with 1E-21 for example.

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

추가 답변 (0개)

카테고리

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