フィルターのクリア

Matlab logic of plotting meshgrid formula

2 ビュー (過去 30 日間)
fima v
fima v 2024 年 4 月 24 日
回答済み: Steven Lord 2024 年 4 月 24 日
There is a code which uses meshgrid which is basicly doing all combination of one vector with the size of the other vector and visa versa. y and z are values of the field in the Y axes and Z axes. In the sum_a_m expression there are .* * / and ./ expresson with the meshgrid Y and Z. What is the logic in that?
Thanks.
y=linspace(-y_lim,y_lim,600);
z=linspace(-z_lim,z_lim,600);
[Y,Z]=meshgrid(y,z);
sum_a_m=0;
for m=-300:300
%sum of evanacent wave coefficients
if(m~=0)
a_m=-1i*sqrt(k^2-k_t_m^2);
sum_a_m=sum_a_m+(exp(-1i*(2*pi*m/d)*Y).*exp(-a_m*abs(Z))./a_m);
end
end
E_total_2_51=E_0*exp(-1i*k*Y*sin(theta_in)).*exp(-1i*k*Z*cos(theta_in)) ...
-((eta*I0)/(2*cos(theta_in)*d)).*exp(-1i*k*Y*sin(theta_in)).*exp(-1i*k*abs(Z)*cos(theta_in))...
-(((1i*k*eta*I0)/(2*d)).*exp(-1i*k.*Y*sin(theta_in)).*sum_a_m);

回答 (1 件)

Steven Lord
Steven Lord 2024 年 4 月 24 日
See this documentation page for a description of the difference between the * and .* operators (and similarly / and ./, etc.)

カテゴリ

Help Center および File ExchangeGrid Lines, Tick Values, and Labels についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by