Search code examples
matlabmatlab-figurestreamline

Matlab:Specific number of streamlines


I have written the code for showing streamlines using the streamslice function. Since using streamline function shows only the lines but not direction, so I have used streamslice. But now I just want to show only four streamlines on the graph.Is it possible to do this using streamslice?

clear all
syms x y
[x,y]=meshgrid(-1:0.1:3,-1:0.1:3.5); 
uu=x; vv=x.*(x-1).*(y+1);
streamslice(x,y,uu,vv)

enter image description here


Solution

  • you can add density for this.

    streamslice(...,density)
    

    when density is higher then 0. the default is 1.