Display precision in Matlab

5 次查看(过去 30 天)
Del
Del 2013-6-18
I am trying to convert this cell array into a matrix of doubles. How do I make matlab display the numbers the way they are without having the 1.0e+06 * on top? I am trying to avoid having to0 many 0.0000 for my table 'to make sense' for the reader. I just want the matrix to be displayed exactly the way it was, except that I don't want the '' around numbers.
Here is cell matrix that I have: N =
Columns 1 through 5
' 1' '1.9949785776' '0.8999118879' 'Yes' '1827.03348285'
' 2' '1.0836978487' '0.9452764208' 'Yes' ' 78.18629935'
' 3' '0.9976185350' '1.0097122925' 'Yes' ' 4.03285577'
' 4' '1.0008070750' '0.9994095511' 'Yes' ' 0.69289935'
' 5' '1.0000809644' '1.0000586921' 'Yes' ' 0.03243612'
' 6' '1.0000095216' '1.0000030561' 'Yes' ' 0.00501940'
' 7' '1.0000009949' '1.0000001012' 'Yes' ' 0.00059278'
' 8' '1.0000000869' '0.9999999505' 'Yes' ' 0.00007005'
' 9' '1.0000000053' '1.0000000085' 'Yes' ' 0.00000074'
'10' '1.0000000008' '0.9999999995' 'Yes' ' 0.00000075'
'11' '1.0000000000' '1.0000000001' 'Yes' ' 0.00000002'
'12' '1.0000000000' '1.0000000000' 'Yes' ' 0.00000000'
Columns 6 through 8
'3341254.146433214' '5999589.356051869' '1.0000000000'
' 6159.968320522' ' 11045.231365608' '0.1000000000'
' 19.837292870' ' 12.464450273' '0.0100000000'
' 0.503191908' ' 0.878853872' '0.0010000000'
' 0.001106715' ' 0.001928861' '0.0001000000'
' 0.000026457' ' 0.000046189' '0.0000100000'
' 0.000000369' ' 0.000000716' '0.0000010000'
' 0.000000005' ' 0.000000010' '0.0000001000'
' 0.000000000' ' 0.000000000' '0.0000000100'
' 0.000000000' ' 0.000000000' '0.0000000010'
' 0.000000000' ' 0.000000000' '0.0000000001'
' 0.000000000' ' 0.000000000' '0.0000000000'
When I use the following command:
N_double=str2double(N)
This is what I get:
N_double =
1.0e+06 *
Columns 1 through 3
0.000001000000000 0.000001994978578 0.000000899911888
0.000002000000000 0.000001083697849 0.000000945276421
0.000003000000000 0.000000997618535 0.000001009712292
0.000004000000000 0.000001000807075 0.000000999409551
0.000005000000000 0.000001000080964 0.000001000058692
0.000006000000000 0.000001000009522 0.000001000003056
0.000007000000000 0.000001000000995 0.000001000000101
0.000008000000000 0.000001000000087 0.000000999999950
0.000009000000000 0.000001000000005 0.000001000000008
0.000010000000000 0.000001000000001 0.000001000000000
0.000011000000000 0.000001000000000 0.000001000000000
0.000012000000000 0.000001000000000 0.000001000000000
Columns 4 through 6
NaN 0.001827033482850 3.341254146433214
NaN 0.000078186299350 0.006159968320522
NaN 0.000004032855770 0.000019837292870
NaN 0.000000692899350 0.000000503191908
NaN 0.000000032436120 0.000000001106715
NaN 0.000000005019400 0.000000000026457
NaN 0.000000000592780 0.000000000000369
NaN 0.000000000070050 0.000000000000005
NaN 0.000000000000740 0
NaN 0.000000000000750 0
NaN 0.000000000000020 0
NaN 0 0
Columns 7 through 8
5.999589356051869 0.000001000000000
0.011045231365608 0.000000100000000
0.000012464450273 0.000000010000000
0.000000878853872 0.000000001000000
0.000000001928861 0.000000000100000
0.000000000046189 0.000000000010000
0.000000000000716 0.000000000001000
0.000000000000010 0.000000000000100
0 0.000000000000010
0 0.000000000000001
0 0.000000000000000
0 0

回答(1 个)

Shashank Prasanna
Shashank Prasanna 2013-6-18

类别

Help CenterFile Exchange 中查找有关 Cell Arrays 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by