Reputation: 3
How to print in Matlab Like following....
0.01000E+02
I have tried
sprintf('%12.5e',[0.01000E+02])
it is giving me
1.00000e+000
Upvotes: 0
Views: 276
Reputation: 3032
Something like ['0.0' strrep(sprintf('%12.5E',v*100), '.', '')]
(with v
your value) should work if I understand correctly your format.
Upvotes: 1
Reputation: 4732
You format is a bit specific. You should consider writing your own output function.
But a few pointers:
upper
new_string = regexprep(old_string,'\d(\d{2})$','\1')
1e2
, print the float and later attach the E+02
. Upvotes: 1