How to plot these equations as a 3d surface plot?
조회 수: 3 (최근 30일)
이전 댓글 표시
I want to 'superimpose' E1(x, y) = 1.0 exp[-jk0(x cos(169) + y sin(169))] exp(j311) , E2(x, y) = 0.8 exp[-jk0(x cos(213) + y sin(213))] exp(j32) , E3(x, y) = 1.1 exp[-jk0(x cos(87) + y sin(87))] exp(j161) such equations and create a single 3d plot.
where the angles re in degrees and k0=2*pi/.33
any help will be appreciated !
댓글 수: 0
채택된 답변
Matt Tearle
2011년 4월 4일
When you use "j" do you mean the imaginary number (sqrt(-1))? If so, these functions have complex values, so how can you have a 3-D plot? Anyway, maybe something like this is what you're looking for:
[x,y] = meshgrid(linspace(-0.5,0.5,201));
k0 = 2*pi/0.33;
E1 = 1.0*exp(-1j*k0*(x*cosd(169) + y*sind(169))).*exp(1j*pi*311/180);
E2 = 0.8*exp(-1j*k0*(x*cosd(213) + y*sind(213))).*exp(1j*pi*32/180);
E3 = 1.1*exp(-1j*k0*(x*cosd(87) + y*sind(87))).*exp(1j*pi*161/180);
surf(x,y,real(E1),'linestyle','none','facealpha',0.4)
hold on
surf(x,y,real(E2),'linestyle','none','facealpha',0.4)
surf(x,y,real(E3),'linestyle','none','facealpha',0.4)
댓글 수: 0
추가 답변 (1개)
참고 항목
카테고리
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!