请教MATLAB编程高手,我解决下面程序出错,但找不出原因,
来源:学生作业帮 编辑:搜狗做题网作业帮 分类:综合作业 时间:2024/07/04 20:56:06
请教MATLAB编程高手,我解决下面程序出错,但找不出原因,
clear
>> dsolve('Dv=m*g/k*s-m*g*exp(-k*s*t/m)/k*s','v(0)=0','t')
ans =
m^2*g/k^2*exp(-k*s/m*t)+m*g/k*s*t-1/k^2*g*m^2
>> syms v s m k g t
>> a=m^2*g/k^2*exp(-k*s/m*t)+m*g/k*s*t-1/k^2*g*m^2;
>> b=int(a,t)
b =
-1/k^3*g*m^3/s*exp(-k*s/m*t)+1/2*m*g/k*s*t^2-1/k^2*g*m^2*t
>> pretty(b)
3 k s t
g m exp(- -----) 2 2
m m g s t g m t
- ----------------- + 1/2 -------- - ------
3 k 2
k s k
>> clear
>> fun=inline('-1/k^3*9.8*27000000/56.52*exp(-k*56.52/300*t)+1/2*300*9.8/k*56.52*t^2-1/k^2*9.8*900*t)',','t');
fun=inline('-1/k^3*9.8*27000000/56.52*exp(-k*56.52/300*t)+1/2*300*9.8/k*56.52*t^2-1/k^2*9.8*900*t)',','t');
|
Error:")" expected,"identifier" found.
>> fun=inline('-1/k^3*9.8*27000000/56.52*exp(-k*56.52/300*t)+1/2*300*9.8/k*56.52*t^2-1/k^2*9.8*900*t)
fun=inline('-1/k^3*9.8*27000000/56.52*exp(-k*56.52/300*t)+1/2*300*9.8/k*56.52*t^2-1/k^2*9.8*900*t)
|
Error:Expected a variable,function,or constant,found "incomplete string".
clear
>> dsolve('Dv=m*g/k*s-m*g*exp(-k*s*t/m)/k*s','v(0)=0','t')
ans =
m^2*g/k^2*exp(-k*s/m*t)+m*g/k*s*t-1/k^2*g*m^2
>> syms v s m k g t
>> a=m^2*g/k^2*exp(-k*s/m*t)+m*g/k*s*t-1/k^2*g*m^2;
>> b=int(a,t)
b =
-1/k^3*g*m^3/s*exp(-k*s/m*t)+1/2*m*g/k*s*t^2-1/k^2*g*m^2*t
>> pretty(b)
3 k s t
g m exp(- -----) 2 2
m m g s t g m t
- ----------------- + 1/2 -------- - ------
3 k 2
k s k
>> clear
>> fun=inline('-1/k^3*9.8*27000000/56.52*exp(-k*56.52/300*t)+1/2*300*9.8/k*56.52*t^2-1/k^2*9.8*900*t)',','t');
fun=inline('-1/k^3*9.8*27000000/56.52*exp(-k*56.52/300*t)+1/2*300*9.8/k*56.52*t^2-1/k^2*9.8*900*t)',','t');
|
Error:")" expected,"identifier" found.
>> fun=inline('-1/k^3*9.8*27000000/56.52*exp(-k*56.52/300*t)+1/2*300*9.8/k*56.52*t^2-1/k^2*9.8*900*t)
fun=inline('-1/k^3*9.8*27000000/56.52*exp(-k*56.52/300*t)+1/2*300*9.8/k*56.52*t^2-1/k^2*9.8*900*t)
|
Error:Expected a variable,function,or constant,found "incomplete string".
![请教MATLAB编程高手,我解决下面程序出错,但找不出原因,](/uploads/image/z/16934395-67-5.jpg?t=%E8%AF%B7%E6%95%99MATLAB%E7%BC%96%E7%A8%8B%E9%AB%98%E6%89%8B%2C%E6%88%91%E8%A7%A3%E5%86%B3%E4%B8%8B%E9%9D%A2%E7%A8%8B%E5%BA%8F%E5%87%BA%E9%94%99%2C%E4%BD%86%E6%89%BE%E4%B8%8D%E5%87%BA%E5%8E%9F%E5%9B%A0%2C)
试试这个:
fun=inline('-1/k^3*9.8*27000000/56.52*exp(-k*56.52/300*t)+1/2*300*9.8/k*56.52*t^2-1/k^2*9.8*900*t)','t');
fun=inline('-1/k^3*9.8*27000000/56.52*exp(-k*56.52/300*t)+1/2*300*9.8/k*56.52*t^2-1/k^2*9.8*900*t)','t');