ploting vectorial expression in 3D question

29 次查看(过去 30 天)
fima v
fima v 2024-10-24,17:51
回答: Divyajyoti Nayak 2024-10-25,6:21
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,6:21
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;

标签

Community Treasure Hunt

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

Start Hunting!

Translated by