fplot invalid parameter error

8 次查看(过去 30 天)
seoung gi Sin
seoung gi Sin 2022-4-24
评论: VBBV 2022-4-24
Error occured at line 19, and it says invalid parameter.
Could you help solve this problem?
m=100;
k1=1500;
k2=2500;
k3=700;
wb=4.4;
Y=0.05;
w1=sqrt(k1/m);
w2=sqrt(k2/m);
w3=sqrt(k3/m);
r1=wb/w1;
r2=wb/w2;
r3=wb/w3;
syms t
yt=Y*sin(wb*t);
X1=Y*1/abs(1-r1^2)*cos(wb*t-pi()/2);
X2=Y*1/abs(1-r2^2)*cos(wb*t-pi()/2);
X3=Y*1/abs(1-r3^2)*cos(wb*t-pi()/2);
fplot(yt,[0:0.1:10])
setcurve('color','black')
hold on
fplot(X1,t,[0:0.1:10])
setcurve('color','red')
fplot(X2,t,[0:0.1:10])
setcurve('color','green')
fplot(X3,t,[0:0.1:10])
legend('yt','x1','x2','x3')
legend('show')

回答(1 个)

VBBV
VBBV 2022-4-24
编辑:VBBV 2022-4-24
m=100;
k1=1500;
k2=2500;
k3=700;
wb=4.4;
Y=0.05;
w1=sqrt(k1/m);
w2=sqrt(k2/m);
w3=sqrt(k3/m);
r1=wb/w1;
r2=wb/w2;
r3=wb/w3;
syms t
yt=Y*sin(wb*t);
X1=Y*1/abs(1-r1^2)*cos(wb*t-pi()/2);
X2=Y*1/abs(1-r2^2)*cos(wb*t-pi()/2);
X3=Y*1/abs(1-r3^2)*cos(wb*t-pi()/2);
fplot(yt,[0 10])
%setcurve('color','black')
hold on
fplot(X1,t,[0 10])
%setcurve('color','red')
fplot(X2,t,[0 10])
%setcurve('color','green')
fplot(X3,t,[0 10]) % use a range
legend('yt','x1','x2','x3')
legend('show')
Specify a range to fplot
  1 个评论
VBBV
VBBV 2022-4-24
fplot(yt,[0 10],'k')
%setcurve('color','black')
hold on
fplot(X1,t,[0 10],'r')
%setcurve('color','red')
fplot(X2,t,[0 10],'g')
%setcurve('color','green')
fplot(X3,t,[0 10],'y') % use a range
legend('yt','x1','x2','x3')
legend('show')
There is no function named setcurve in MATLAB

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Startup and Shutdown 的更多信息

标签

产品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by