Azzera filtri
Azzera filtri

Am I using fplot correct?

1 visualizzazione (ultimi 30 giorni)
Seungwon Lee
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

Risposta accettata

Star Strider
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
Seungwon Lee
Seungwon Lee il 23 Apr 2020
thank you
Star Strider
Star Strider il 23 Apr 2020
As always, my pleasure!

Accedi per commentare.

Più risposte (0)

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by