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.

 Akzeptierte Antwort

Star Strider
Star Strider am 19 Jun. 2019

1 Stimme

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 Kommentare

Le Xuan Thang
Le Xuan Thang am 19 Jun. 2019
Zalo_ScreenShot_19_6_2019_163908.png
Le Xuan Thang
Le Xuan Thang am 19 Jun. 2019
Bearbeitet: Le Xuan Thang am 19 Jun. 2019
here is my problem. i don't know how to fix this. Many thank
Star Strider
Star Strider am 19 Jun. 2019
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 am 19 Jun. 2019
Thank you, sir. I'll check again my function. many thank.
Star Strider
Star Strider am 19 Jun. 2019
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 am 19 Jun. 2019
i find out my problem. It is boundary condition of my function. many thank sir.
Star Strider
Star Strider am 19 Jun. 2019
As always, my pleasure.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Produkte

Version

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by