Why I can't plot this one?
显示 更早的评论
clear clc
xss=0.01;
omegaf = 40;
omegan = 20;
n=0.1;
syms x(t) A B
v(t) = diff(x,t);
x0 =0.05;
v0 =2;
eq1 = xss * cos(omegaf*t) + (A*sin(omegan*t) +B* cos(omegan*t))*exp(-n*omegan*t) == x;
eq2 = diff(eq);
eq3 = subs( eq1 , [x(t),t] , [x0,0]);
eq4 = subs( eq2 , [v(t),t] , [v0,0]);
[D,C] = equationsToMatrix([eq3,eq4],[A,B]);
Res = linsolve(D,C);
eq1 = subs(eq1, [A,B] ,[Res(1),Res(2)]);
t=0:4;
plot(t,eq1)
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Operations on Strings 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!