opiticer
opiticer
采纳率66.7%
2016-05-18 15:30 阅读 2.0k
已采纳

Matlab 变量值直接输出 和 sprintf输出 不同是怎么回事?

 nitao=2.175;
nitae=2.18;
derta33=30.3;
derta13=5.7;
L=0.1;%m
lamda0=0.633*10^(-6);%m
Vm=100;%v
e=43;
A=10^(-3);%m^2
dertaf=10^7;%Hz

syms Ez;
E=solve(2*pi*L/lamda0*((nitao-nitae)+Ez*(nitae^3*derta33-nitao^3*derta13)/2)==pi,Ez);
E
sprintf('半波电场强度:%e','E')

Vpi=E*L;
dertaph=Vm*pi/Vpi;
dertaph
sprintf('相位延迟:%e','dertaph')

P=e*A*Vpi^2*dertaph^2*dertaf/(pi*L);
P
sprintf('驱动功率%e','P')

结果:
E =

(9444732965739290427392*pi)/1196549586897533007794808436155 + 11258999068427/287405211048345088

ans =

半波电场强度:6.900000e+01

dertaph =

(100*pi)/((4722366482869645213696*pi)/5982747934487665038974042180775 + 11258999068427/2874052110483450880)

ans =

相位延迟:1.000000e+02相位延迟:1.010000e+02相位延迟:1.140000e+02相位延迟:1.160000e+02相位延迟:9.700000e+01相位延迟:1.120000e+02相位延迟:1.040000e+02

P =

43000000000*pi

ans =

驱动功率8.000000e+01

为什么变量值和sprintf的值不一样?
为什么相位延迟有这么多个?

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

2条回答 默认 最新

  • 已采纳
    opiticer opiticer 2016-05-19 14:07

    解决了。。
    我自问自答吧[侧目]
    是酱紫:

     syms Ez;
    E=solve(2*pi*L/lamda0*((nitao-nitae)+Ez*(nitae^3*derta33-nitao^3*derta13)/2)==pi,Ez);
    E
    sprintf('半波电场强度:%e',double(E))
    
    Vpi=E*L;
    dertaph=Vm*pi/Vpi;
    dertaph
    sprintf('相位延迟:%e',double(dertaph))
    
    P=e*A*Vpi^2*dertaph^2*dertaf/(pi*L);
    P
    sprintf('驱动功率%e',double(P))
    

    就得到:

     E =
    (9444732965739290427392*pi)/1196549586897533007794808436155 + 11258999068427/287405211048345088
     ans =
     半波电场强度:3.919945e-05
    dertaph = 
    (100*pi)/((4722366482869645213696*pi)/5982747934487665038974042180775 + 11258999068427/2874052110483450880)
     ans =
    相位延迟:8.014380e+07
    P =
     43000000000*pi
     ans =
    驱动功率1.350885e+11
    

    是符合的

    点赞 评论 复制链接分享
  • devmiao devmiao 2016-05-18 15:31

相关推荐