Am I using fplot correct?
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
Seungwon Lee
il 23 Apr 2020
Commentato: Star Strider
il 23 Apr 2020
syms x
y1 = 0.35*exp(-3*x)-0.15*exp(3*x)
fplot(y1,[-10,10])
hold on
y2 = 0.2*cos(3*x)-0.5*sin(3*x)
fplot(y2,[-10,10])
legend('y1','y2')
I want to know if graph y1, y2 are equal so i want to compare them.
But when i execute this code y2 seems to be y=0
help please
0 Commenti
Risposta accettata
Star Strider
il 23 Apr 2020
The y-axis scales are significantly different, so ‘y2’ will appear to be 0 when it actually is not. Multiply ‘y2’ by a suitably large constant to make it visible:
syms x
y1 = 0.35*exp(-3*x)-0.15*exp(3*x)
fplot(y1,[-1,1]*10)
hold on
y2 = 0.2*cos(3*x)-0.5*sin(3*x)
fplot(y2*1E+11,[-1 1]*10)
hold off
legend('y1','y2\times10^{11}')
.
2 Commenti
Più risposte (0)
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!