why does matlab give scientific notation if I use a variable in the operation?
조회 수: 1 (최근 30일)
이전 댓글 표시
t1 = 2.4735;
>> t1*2000
ans = 4.9471e+03
>> 2.4735*2000
ans = 4947
I would like to get the result from the operation using the variable t1 in decimals notation
댓글 수: 0
답변 (2개)
Walter Roberson
2017년 10월 19일
I suspect that your t1 is not exactly 2.4735. You should try 4947/2000 - t1 to see the difference.
댓글 수: 0
Steven Lord
2017년 10월 19일
Change the display format using the format command. Note that this does NOT change how the value is stored or used in computation, just how it is displayed. So keep Walter's Answer in mind.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!