在 MATLAB 中将 2D 向量的 3D 演化绘制为带状
我想绘制二维矢量的幅度和方向如何随时间变化的图。为此,我想创建一个让人想起规范 E & 的图表。您可能还记得电学和磁学入门课程中的 B 场图。
具体来说,我想用丝带连接我的 2D 矢量点,以便它们很容易看到。在 MATLAB 中是否有一种简单的方法可以做到这一点? quiver3
非常接近,但缺少功能区。也许某种参数化曲面?
I would like to plot how the amplitude and orientation of a 2D vector evolves over time. To do this I would like to create a graph reminiscent of the canonical E & B field graphs you may recall from an introductory electricity and magnetism class.
Specifically, I would like to connect my 2D vector points with a ribbon, so that they are easy to see. Is there a simple way to do this in MATLAB? quiver3
is pretty close, but it lacks the ribbon. Perhaps some sort of parametric surface?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以使用绘图函数 FILL3 和 QUIVER3 执行如下操作:
这是结果图:
You can use the plotting functions FILL3 and QUIVER3 to do something like this:
And here's the resulting plot:
这是一个在 3D 空间中的任意两条线之间绘制一条丝带的解决方案。你可以在它上面绘制你的箭袋&使用 'FaceAlpha' 调整不透明度,就像 gnovice 的解决方案一样
为了使函数更清晰,我首先发布它,而不进行错误检查和调整函数大小(它们构成了函数主体的大部分并且不是特别有趣)
使用这个实际代码中的错误检查版本:
here's a solution that draws a ribbon between any two lines in 3D space. you can plot your quiver over it & adjust the opacity using 'FaceAlpha' as in gnovice's solution
To make the function clearer, I am first posting it without error-checking and resizing functions (which make up most of the body of the function & aren't particularly interesting)
use this error-checking version in your actual code: