Looking to flip plot
3 views (last 30 days)
Show older comments
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');
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/417113/image.jpeg)
0 Comments
Answers (1)
Adam Danz
on 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
0 Comments
See Also
Categories
Find more on Operators and Elementary Operations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!