ploting vectorial expression in 3D question
29 views (last 30 days)
Show older comments
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)
0 Comments
Answers (1)
Divyajyoti Nayak
on 25 Oct 2024 at 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;
0 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!