I want to add phases in for loop and after adding a new phase I want to export this data? How can I do this? Can you show me where I do wrong?

m = (BesselJ[0, LP0na[[n]]*(x^2 + y^2)^0.5/5]*Cos[0*ArcTan[x, y]]*
  Exp[-I*Sqrt[(1.476*2*Pi/1.55)^2 - (LP0na[[n]]/5)^2]*10^4 + 

k= (BesselJ[0, LP0na[[n]]]/
  BesselK[0, Sqrt[4.459^2 - LP0na[[n]]^2]] BesselK[0, 
   Sqrt[4.459^2 - LP0na[[n]]^2]*(x^2 + y^2)^0.5/5]*
  Cos[0*ArcTan[x, y]]*
  Exp[-I*Sqrt[(1.476*2*Pi/1.55)^2 - (Sqrt[4.459^2 - LP0na[[n]]^2]/
        5)^2]*10^4 + i*0.25*Pi]);
n = Table[
   If[(x^2 + y^2) < 25, m, k], {x, -6, 6, 0.241/5}, {y, -6, 6, 
For[i = 0; n = x, i < 8, i++, n = n; Print[n]]
  • $\begingroup$ What do you get as output? $\endgroup$ – Kiro Apr 19 '17 at 8:58
  • $\begingroup$ @Kiro I can not get any output. Actually I want to get a matrix and which phase makes total matrix elements maximum. $\endgroup$ – halil ibrahim Binici Apr 19 '17 at 9:07
  • $\begingroup$ It's unclear to me what you are asking. What is the form of the matrix elements? $\endgroup$ – Kiro Apr 19 '17 at 9:37
  • $\begingroup$ Can you break this problem up into smaller pieces that are easy to explain? You say you are trying to create a matrix. Perhaps you could try creating a simpler matrix first, and make it slightly more complicated until you find a problem? $\endgroup$ – jjc385 Apr 19 '17 at 16:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.