필터 지우기
필터 지우기

How to get rid of exp in answer

조회 수: 1 (최근 30일)
Sergey Dukman
Sergey Dukman 2015년 6월 9일
댓글: Roger Stafford 2015년 6월 9일
I have evaluated a polynomial of the 6th order.
One of the calculated coefficients has a value of -4.1275e-05 (format short g).
How can I represent this answer as a "normal" number without exp?

채택된 답변

Roger Stafford
Roger Stafford 2015년 6월 9일
Use 'fprintf' with the fixed-point format type %f. For example with your value you could use fprintf('%12.9f',value) to get -0.000041275
  댓글 수: 2
Sergey Dukman
Sergey Dukman 2015년 6월 9일
Hei! Thank you. It works. The only thing I did not get is this - '%12.9f'. Would you explain me please what does it mean?
Roger Stafford
Roger Stafford 2015년 6월 9일
The % on the left and f on the right mean fixed-point type format. The 12 is the total field width and the 9 is the number of digits after the decimal point. You can read all about the format specs in the site:
http://www.mathworks.com/help/matlab/ref/fprintf.html
Note that these format specs for matlab's fprintf are very similar to those of the C language for printf.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Polynomials에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by