Why plotting the first derivative of my function gets shrinked on its amplitud?

1 visualizzazione (ultimi 30 giorni)
x = linspace(-2*pi,2*pi,100); y1 = sin(x); y2 = diff(y1); figure plot(y2);

Risposte (1)

Jan
Jan il 25 Set 2017
Modificato: Jan il 25 Set 2017
What is the derivative of sin(a * t)?
a * cos(a * t)
Try it:
x = linspace(-2*pi, 2*pi, 100);
y1 = sin(x);
y2 = diff(y1);
figure
plot(x, y1, 'r');
hold('on');
plot(x, y2, 'g');
x2 = linspace(-2*pi, 2*pi, 200); % Time with double resolution
y3 = sin(x2);
y4 = diff(y3);
plot(x2, y4, 'b')

Categorie

Scopri di più su Animation in Help Center e File Exchange

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by