Superimpose the graph of a function onto a streamline field

1 次查看(过去 30 天)
Hi, I have to plot a streamline field given a 2D velocity vector and then superimpose 2 other functions (streamlines at given points) over it. I have already written the code for the streamline field, but am lost as to how I can plot the other functions along with the field in the same figure. How can I go about doing this? Thanks, David
The code I am using:
close all;
clc;
clear all;
xmin=-1;
xmax=1;
ymin=-1;
ymax=1;
h=0.6;
[x,y] = meshgrid(xmin:h:xmax,ymin:h:ymax);
u = y./(x.^2+y.^2);
v = -x./(x.^2+y.^2);
figure
quiver(x,y,u,v)
startx = xmin:h:xmax;
starty = ymin:h:ymax;
h = streamline(x,y,u,v,startx,starty);
set(h,'color','red')

采纳的回答

Gaurav Garg
Gaurav Garg 2020-10-19
Hey David,
You can try using hold on function.
One such example can be found here.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Vector Fields 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by