在MATLAB中绘制3D矢量在3D中的演变

And*_*dyL 3 math matlab plot graph

我想绘制2D矢量的幅度和方向如何随时间演变.要做到这一点,我想创建一个让人想起规范的E&B场图的图表,您可以从介绍性的电力和磁力类中回忆起这些图表.

具体来说,我想用带子连接我的2D矢量点,这样它们很容易看到.在MATLAB中有一个简单的方法吗?quiver3非常接近,但缺乏功能区.也许是某种参数曲面?

gno*_*ice 5

您可以使用绘图功能FILL3QUIVER3执行以下操作:

x = linspace(0,4*pi,30);  %# Create some x data
y1 = sin(x);              %# Create wave 1
y2 = sin(x-pi);           %# Create wave 2
u = zeros(size(x));       %# Create a vector of zeroes

hRibbon1 = fill3(x,y1,u,'r');     %# Plot wave 1 and fill underneath with color
set(hRibbon1,'EdgeColor','r',...  %# Change the edge color and
             'FaceAlpha',0.5);    %#   make the colored patch transparent
hold on;                          %# Add to the existing plot
quiver3(x,u,u,u,y1,u,0,'r');      %# Plot the arrows

hRibbon2 = fill3(x,u,y2,'b');     %# Plot wave 2 and fill underneath with color
set(hRibbon2,'EdgeColor','b',...  %# Change the edge color and
             'FaceAlpha',0.5);    %#   make the colored patch transparent
quiver3(x,u,u,u,u,y2,0,'b');      %# Plot the arrows
axis equal;                       %# Use equal axis scaling
Run Code Online (Sandbox Code Playgroud)

这是由此产生的情节:

替代文字