Streamline Not Displaying On 2D Vector Field
조회 수: 5 (최근 30일)
이전 댓글 표시
I am trying to plot a streamline of a negative 2D vector field. When I plot the positive version of the equation, I get this:
Okay, great. Now to change the V_0 variable from 1 to -1:
Despite messing with startx and starty to try and make it plot, I cannot figure it out. Using the Plot Browser, there is clearly something there, but it looks like an array of independent data points instead of a line curve:
Footnote: I acknowledge the clunkiness of two startxs and two plot commands, but when one startx and plot command are alone, streamlines only plot on one side of x = 0. Code:
Any help greatly appreciated.
V_0 = -1; % When this is positive, I get the first graph image. When it is negative, I get the second.
L = 2;
x = (-1:0.1:1);
y = (0:0.1:1);
[X,Y] = meshgrid(x,y);
u = (V_0/L)*(-2*X);
v = (V_0/L)*(Y);
quiver(X,Y,u,v);
starty = (-2:0.025:2); % I know the issue exsits with this
startx1 = ones(size(starty)); % and/or this
hold on
streamline(X,Y,u,v,startx1,starty)
startx2 = ones(size(starty))*min(x); % and/or this, but cannot determine the issue. This code generates no errors.
streamline(X,Y,u,v,startx2,starty)
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Volume Visualization에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!