Unable to fetch more decimal points for values stored in sldd

I have a variable (name : dummyVar) in sldd with value 132.99525
When i fetch this variable from sldd using matlab code and checked the value.
The value fetched using matlab code was 132.9952.
Not all decimal points fetched here. I would like to understand the reason behind this behaviour !!

답변 (2개)

John D'Errico
John D'Errico 2025년 10월 23일
편집: John D'Errico 2025년 10월 23일
You need to learn about the format command. All of the digits are still there, they were just not reported. I'll add a few digits.
x = 132.9952512345
x = 132.9953
The default for format is short.
help format
format - Set output display format This MATLAB function changes the output display format to the format specified by style. Syntax format(style) fmt = format fmt = format(style) Input Arguments style - Format to apply character vector | string scalar | DisplayFormatOptions object Output Arguments fmt - Current display format DisplayFormatOptions object Examples openExample('matlab/ChangeCurrentFormatExample') openExample('matlab/DisplayValuesinDefaultandHexadecimalFormatExample') openExample('matlab/DifferenceBetweenShortandLongEngineeringNotationExample') openExample('matlab/DisplayLargeDataRangeUsingshortgFormatExample') web /MATLAB/help/matlab/ref/format.html#mw_5f3d66eb-5e13-4517-8573-e60f3f48169c openExample('matlab/GetCurrentFormatExample') openExample('matlab/SaveAndRestoreDisplayFormatExample') See also DisplayFormatOptions, disp, fprintf, formattedDisplayText Introduced in MATLAB before R2006a Documentation for format doc format
F = format
F =
DisplayFormatOptions with properties: NumericFormat: "short" LineSpacing: "loose"
However, you want to see more digits. long g is generally a good choice.
format long g
x
x =
132.9952512345
If you want even more control, you can always use tools like sprintf.
dpb
dpb 2025년 10월 23일
이동: dpb 2025년 10월 23일
Don't confuse display with value...try
format longg
dummyVar
format short
dummyVar
"format short" is the default setting; you can change that in the user preferences or dynamically at will...
See format for all the choices available.

카테고리

도움말 센터File Exchange에서 Analysis of Variance and Covariance에 대해 자세히 알아보기

제품

릴리스

R2022b

태그

질문:

2025년 10월 23일

편집:

2025년 10월 23일

Community Treasure Hunt

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

Start Hunting!

Translated by