fplot invalid parameter error

13 vues (au cours des 30 derniers jours)
seoung gi Sin
seoung gi Sin le 24 Avr 2022
Commenté : VBBV le 24 Avr 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')

Réponses (1)

VBBV
VBBV le 24 Avr 2022
Modifié(e) : VBBV le 24 Avr 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 commentaire
VBBV
VBBV le 24 Avr 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

Connectez-vous pour commenter.

Catégories

En savoir plus sur MATLAB dans Help Center et File Exchange

Tags

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by