fplot invalid parameter error

12 views (last 30 days)
seoung gi Sin
seoung gi Sin on 24 Apr 2022
Commented: VBBV on 24 Apr 2022
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')

Answers (1)

VBBV
VBBV on 24 Apr 2022
Edited: VBBV on 24 Apr 2022
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 Comment
VBBV
VBBV on 24 Apr 2022
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

Sign in to comment.

Categories

Find more on MATLAB in Help Center and File Exchange

Tags

Products

Community Treasure Hunt

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

Start Hunting!