Could someone explain what the code means

1 回表示 (過去 30 日間)
J K
J K 2019 年 6 月 30 日
コメント済み: Rena Berman 2019 年 9 月 19 日
Hi guys,
If I have the following code:
z = 1:0.5:9;
for j = 1:9
functione = exp(-((W-w_o).^2)/deltaW.^2).*exp(-(Kx.^2+Ky.^2)/(deltaK.^2)).*exp(1i.*sqrt((W/c).^2-(Kx.^2+Ky.^2)).*z(j));
What does it really mean? Do I run the "functione" 9 times with z1=1, z2=1.5, z3=2, ...z9=5? So I never actually make it to z=9?
Thank you!
  1 件のコメント
Rena Berman
Rena Berman 2019 年 9 月 19 日
(Answers Dev) Restored edit

サインインしてコメントする。

回答 (1 件)

per isakson
per isakson 2019 年 6 月 30 日
Comments on your code fragment
  • the end of the for-loop is not shown, thus it is not clear how the value of functione is used
  • functione is a variable with a really poor name
  • the statements of the loop are executed for z = 1:0.5:5

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by