Azzera filtri
Azzera filtri

Looking to flip plot

3 visualizzazioni (ultimi 30 giorni)
Ethan Rando
Ethan Rando il 17 Nov 2020
Risposto: Adam Danz il 17 Nov 2020
Hello I am looking to make this plot accurate. For some reason it is spiraling clockwise when it should be spiraling counter clockwise with the same shape. Any help with this would be great.
It is basically flipped on both the x and y-axis from how it should be.
[x, y] = meshgrid(-2.5:.5:2.5, -2.5:.5:2.5);
xdot = (-1*x) + (2*y);
ydot = (-1*x) + (-3*y);
figure(1)
streamslice(x,y, xdot, ydot, 'black')
grid on
xlabel('X');
ylabel('Y');
title('#2');

Risposte (1)

Adam Danz
Adam Danz il 17 Nov 2020
Flip the xdot, ydot vectors and their sign
[x, y] = meshgrid(-2.5:.5:2.5, -2.5:.5:2.5);
xdot = (-1*x) + (2*y);
ydot = (-1*x) + (-3*y);
xdot = -fliplr(xdot); % <----
ydot = -flipud(ydot); % <----
figure(1)
streamslice(x,y, xdot, ydot, 'black')
grid on
xlabel('X');
ylabel('Y');
title('#2');
axis tight

Categorie

Scopri di più su Operators and Elementary Operations in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by