fplot invalid parameter error
13 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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')
0 comentarios
Respuestas (1)
VBBV
el 24 de Abr. de 2022
Editada: VBBV
el 24 de Abr. de 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 comentario
VBBV
el 24 de Abr. de 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
Ver también
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!