plotting streamlines from velocity components
显示 更早的评论
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 个评论
Wick
2018-5-1
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
2018-5-1
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.
采纳的回答
更多回答(2 个)
Syed Fazuruddin
2020-4-1
0 个投票
How to draw a wavy wall of a square in matlab
类别
在 帮助中心 和 File Exchange 中查找有关 Vector Fields 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!