ploting vectorial expression in 3D question
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Antworten (1)
Divyajyoti Nayak
am 25 Okt. 2024
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 Kommentare
Siehe auch
Kategorien
Mehr zu Surface and Mesh Plots finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!