![How to draw a electromagnetic wave and plot it in 3D - 2019 03 23.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/210008/How%20to%20draw%20a%20electromagnetic%20wave%20and%20plot%20it%20in%203D%20-%202019%2003%2023.png)
How to draw a electromagnetic wave and plot it in 3D
83 次查看(过去 30 天)
显示 更早的评论
I have an equation for an electric and magentic wave. Very simply they look like
and
. where A, ω, k are just constants. I want to plot these in a 3-dimensional space. I'm not sure if I even need to include the time t since I only need a snap shot at one instance in time. I have tried surface plot and fplot3 to no success. I want something that looks like: ![Capture.PNG](https://www.mathworks.com/matlabcentral/answers/uploaded_files/210007/Capture.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/210005/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/210006/image.png)
![Capture.PNG](https://www.mathworks.com/matlabcentral/answers/uploaded_files/210007/Capture.png)
0 个评论
采纳的回答
Star Strider
2019-3-23
I’m not certain what you want.
Try this:
E = 2;
H = 3;
t = linspace(0, 2*pi);
omega = 2;
k = pi/2;
x = ones(size(t));
c = cos(omega*t - k*x);
figure
patch([t fliplr(t)], [c zeros(size(c))], [zeros(size(t)) zeros(size(t))], 'b')
hold on
patch([t fliplr(t)], [zeros(size(t)) zeros(size(t))], [c zeros(size(c))], 'r')
hold off
grid on
view(40, 40)
producing this figure:
![How to draw a electromagnetic wave and plot it in 3D - 2019 03 23.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/210008/How%20to%20draw%20a%20electromagnetic%20wave%20and%20plot%20it%20in%203D%20-%202019%2003%2023.png)
1 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Surface and Mesh Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!