plotting streamlines from velocity components
Show older comments
I am having trouble creating streamlines in MATLAB. I have: (1) x,y,z coordinates and (2) velocity components (Vx, Vy, Vz).
I have no trouble plotting the quiver (arrow) plot, but I cannot figure out the streamlines.
Any help would be greatly appreciated.
Thanks,
-Mike
3 Comments
Wick
on 1 May 2018
Have you tried the 'streamline' command? The example in the help is decent. The trick is you've got to pick the (x, y, z) points to start from and it will "connect the dots" from there until the streams pass outside of the range of the data. It doesn't automatically create a new streamline for every data point.
Michael Wales
on 1 May 2018
So your X and and Y are not plaid (as if created by meshgrid).
Are you fields continuous, differentiable, and functions? That is, for every (x,y,z) value, do you only have one (u,v,w)? If so, your best bet is to create a 3D plaid grid using ndgrid covering the (x,y,z) domain of interest. Then use some sort of interpolation to fill in the velocities for every point. The function 'scatteredInterpolant' is probably your friend here. The you can use commands like mesh, surf, slice, streamlines, and others that expect 2- or 3D rectangular data to work with.
Edit: I'm not sure my comment addressed your concern. Can you upload a .mat file with some values I can try to work with? I can then write you some code that will manipulate it properly.
Accepted Answer
More Answers (2)
Michael Wales
on 1 May 2018
0 votes
Syed Fazuruddin
on 1 Apr 2020
0 votes
How to draw a wavy wall of a square in matlab
Categories
Find more on Vector Fields 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!