MATLAB solve解方程,已经赋值变量,结果仍然还有变量
symsPR1Sp;PR1=0.57;Sp=3;[S1,Sd,Sdp]=solve('0.5744==log(1500)/(log(1500)+S1)','S1==Sdp...
syms PR1 Sp;
PR1=0.57;Sp=3;
[S1,Sd,Sdp]=solve('0.5744==log(1500)/(log(1500)+S1)','S1==Sdp+Sp','9==Sdp+3+Sd','S1','Sd','Sdp')
结果
S1 =
5.4187092561727581656058737313416
Sd =
Sp + 0.58129074382724183439412626865839
Sdp =
5.4187092561727581656058737313416 - 1.0*Sp 展开
PR1=0.57;Sp=3;
[S1,Sd,Sdp]=solve('0.5744==log(1500)/(log(1500)+S1)','S1==Sdp+Sp','9==Sdp+3+Sd','S1','Sd','Sdp')
结果
S1 =
5.4187092561727581656058737313416
Sd =
Sp + 0.58129074382724183439412626865839
Sdp =
5.4187092561727581656058737313416 - 1.0*Sp 展开
1个回答
展开全部
出在问题原因有:
1、声明变量错误,变量应该写所求的变量。正确的写法
syms S1 Sd Sdp;
2、 solve 命令函数 书写错误(多了单引号)。正确的写法
[S1,Sd,Sdp]=solve(0.5744==log(1500)/(log(1500)+S1),S1==Sdp+Sp,9==Sdp+3+Sd,'S1','Sd','Sdp')
运行下列代码
>>syms S1 Sd Sdp;
>>PR1=0.57;Sp=3;
>>[S1,Sd,Sdp]=solve(0.5744==log(1500)/(log(1500)+S1),S1==Sdp+Sp,9==Sdp+3+Sd,'S1','Sd','Sdp')
>> S1=vpa(S1,10)
>> Sd=vpa(Sd,10)
>> Sdp=vpa(Sdp,10)
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询