ploting vectorial expression in 3D question

3 次查看(过去 30 天)
Hello,I have the formula and photo shown below.
Is there a way to do a similar plot in matlab (if vectorial arrows is possible then its great)

回答(1 个)

Divyajyoti Nayak
Divyajyoti Nayak 2024-10-25
Hi Fima,
The electromagnetic wave can be plotted using the “plot3” function and the arrow heads can be plotted using the “quiver3” function. Here are the documentation links to help you out along with some sample code to plot a similar plot:
clc
clear
x = linspace(0,4*pi,100);
figure;
plot3(x,zeros(1,100),zeros(1,100),'k','LineWidth',2);
hold on
plot3(x,-sin(x),zeros(1,100),'k');
plot3(x,zeros(1,100),sin(x),'k');
x_quiver = 0:pi/4:4*pi;
q1 = quiver3(x_quiver,zeros(1,17),zeros(1,17),zeros(1,17),-sin(x_quiver),zeros(1,17),0);
q2 = quiver3(x_quiver,zeros(1,17),zeros(1,17),zeros(1,17),zeros(1,17),sin(x_quiver),0);
hold off;

类别

Help CenterFile Exchange 中查找有关 Surface and Mesh Plots 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by