一道matlab的题目,clearm_num=input('m=')p_num=input('p=')t_num=input('t=')s_num=input('s=')D_num=input('D=')d_num=input('d=')f=sym('9.8/18*(6*m/(pi*d)-p*d.^2)*t/s*D/(D+2.4*d)');dfdm=diff(f,'m')dfdp=diff(f,'p')dfdt=diff(f,'t')dfds=diff(f,'s')dfdD=

来源:学生作业帮助网 编辑:作业帮 时间:2024/11/02 23:24:37

一道matlab的题目,clearm_num=input('m=')p_num=input('p=')t_num=input('t=')s_num=input('s=')D_num=input('D=')d_num=input('d=')f=sym('9.8/18*(6*m/(pi*d)-p*d.^2)*t/s*D/(D+2.4*d)');dfdm=diff(f,'m')dfdp=diff(f,'p')dfdt=diff(f,'t')dfds=diff(f,'s')dfdD=
一道matlab的题目,
clear
m_num=input('m=')
p_num=input('p=')
t_num=input('t=')
s_num=input('s=')
D_num=input('D=')
d_num=input('d=')
f=sym('9.8/18*(6*m/(pi*d)-p*d.^2)*t/s*D/(D+2.4*d)');
dfdm=diff(f,'m')
dfdp=diff(f,'p')
dfdt=diff(f,'t')
dfds=diff(f,'s')
dfdD=diff(f,'D')
dfdd=diff(f,'d')
dfdm_num=subs(dfdm,'m',m_num);
dfdp_num=subs(dfdp,'p',p_num);
dfdt_num=subs(dfdt,'t',t_num);
dfds_num=subs(dfds,'s',s_num);
dfdD_num=subs(dfdD,'D',D_num);
dfdd_num=subs(dfdd,'d',d_num);
请问为什么总是报错呢?
Error using sym>convertExpression (line 1379)
Conversion to 'sym' returned the MuPAD error:Error:
Invalid input.'expression' is expected.[line 1,col
10]

一道matlab的题目,clearm_num=input('m=')p_num=input('p=')t_num=input('t=')s_num=input('s=')D_num=input('D=')d_num=input('d=')f=sym('9.8/18*(6*m/(pi*d)-p*d.^2)*t/s*D/(D+2.4*d)');dfdm=diff(f,'m')dfdp=diff(f,'p')dfdt=diff(f,'t')dfds=diff(f,'s')dfdD=
把f=sym('9.8/18*(6*m/(pi*d)-p*d.^2)*t/s*D/(D+2.4*d)');这句
改成
syms m p t s D d
f=9.8/18*(6*m/(pi*d)-p*d.^2)*t/s*D/(D+2.4*d);