Closing exponential display while using fprintf

20 次查看(过去 30 天)
tp(1,1)=0.000025
ac(1,1)=0.00033
formatSpec = 'dx(m) ';
formatSpec2=tp(1,1);
formatSpec2=num2str(formatSpec2)
formatSpec2_2=ac(1,1)
fprintf(fileID,'%3s %20s %30s\n',formatSpec,formatSpec2,formatSpec2_2)
%in this case doubles are written in microsoft word with exponential display, how can I close this displaying?

采纳的回答

Daniele Favot
Daniele Favot 2013-7-25
tp(1,1)=0.000025;
ac(1,1)=0.00033;
formatSpec = 'dx(m) ';
formatSpec2=tp(1,1);
formatSpec2_2=ac(1,1)
fprintf(fileID,'%3s %20f %30f\n',formatSpec,formatSpec2,formatSpec2_2)
  2 个评论
sermet
sermet 2013-7-25
It produce wrong result, numbers are changes, absurdly.
Daniele Favot
Daniele Favot 2013-7-25
If I run:
clc
clear
tp(1,1)=0.000025;
ac(1,1)=0.00033;
formatSpec = 'dx(m) ';
formatSpec2=tp(1,1);
formatSpec2_2=ac(1,1);
fprintf('%3s %20f %30f\n',formatSpec,formatSpec2,formatSpec2_2)
what is printed in the command window is:
dx(m) 0.000025 0.000330
Maybe the problem is in how you write in the word file this numbers and not in the fprintf command

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Fuzzy Logic Toolbox 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by