i want to see very long digit scaled fixed point
Example: i have a number: 8.123 e-15. And after that. e-16 become to 0. And i want see more. Anyone can tell me how to fix this? . Many thank.

 채택된 답변

Star Strider
Star Strider 2019년 6월 19일

1 개 추천

I ma not certain what problem you are seeing.
The format function may be what you want.
For example:
format long e
n = 8.123e-15
n = n/100
produces:
n =
8.123000000000000e-15
n =
8.123000000000000e-17

댓글 수: 7

Le Xuan Thang
Le Xuan Thang 2019년 6월 19일
Zalo_ScreenShot_19_6_2019_163908.png
Le Xuan Thang
Le Xuan Thang 2019년 6월 19일
편집: Le Xuan Thang 2019년 6월 19일
here is my problem. i don't know how to fix this. Many thank
Star Strider
Star Strider 2019년 6월 19일
I am not certain what the actual problem is. That appears to be the iteration output of of an optimisation function, so the format is likely controlled from within the function. In that instance, there is likely not much you can do about it, since that would involve hacking the function, never a good idea.
Also, the jump from 5.0487e-29 to 0 in one iteration is unlikely to be due to precision, since the smallest floating-point number (on my computer) is 22.2507e-309, produced by the realmin function. The optimisation function is apparently deciding on its own that the cost function output smaller than 5.0487e-29 is effectively 0. That could be due to the way the tolerances are set within the function (although you can likely change them with an options structure for the fucntion if you want to).
Be sure to return as many outputs from the optimisation function as seems reasonable, particularly the final function value. That may be what you actuallky want.
Le Xuan Thang
Le Xuan Thang 2019년 6월 19일
Thank you, sir. I'll check again my function. many thank.
Star Strider
Star Strider 2019년 6월 19일
As always, my pleasure.
Your objective function or cost funciton is likely not the problem. This is most likely the expected behaviour of the optimisation function you are using.
Le Xuan Thang
Le Xuan Thang 2019년 6월 19일
i find out my problem. It is boundary condition of my function. many thank sir.
Star Strider
Star Strider 2019년 6월 19일
As always, my pleasure.

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Spline Postprocessing에 대해 자세히 알아보기

제품

릴리스

R2018b

질문:

2019년 6월 19일

댓글:

2019년 6월 19일

Community Treasure Hunt

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

Start Hunting!

Translated by