I am just getting started using Mathematica. I have a code I developed in Matlab, but I realize now that Matlab does not calculate Macdonald functions of imaginary order. So, here I am with Mathematica. I have a *.csv file with numeric data array. I figured out how to read in array, but cannot find anything to instruct me how to extract element-wise values that I can use in computations. The convention of “{{ }}”, or “[{ }]”, or “[[ ]]” is not explained in any of the documentation, and no combination I try works. I am trying to extract, for instance, element at position [2,3] of the array to perform a calculation. The output I get is taking the entire array and performing the calculation on all elements. How do I get the calculation on the single element I want?
Thanks for all the good help. I was able to get started using the following simple:
ae = Table[0, {Nd}];
Zae = Table[0, {Nd}];
Zbe = Table[0, {Nd}];
For[Nd = 1, Nd < Necc + 1, Nd++,
g = gap[[Nd]];
Da = 2 ra 1000;
Db = 2 rb 1000;
ae[[Nd]] = (g (Db - g) (Db - Da - g) (Da + g))^0.5 /(Db - Da - 2 g);
Zae[[Nd]] = ArcSinh[2 ae[[Nd]] /Da];
Zbe[[Nd]] = ArcSinh[2 ae[[Nd]] /Db];
a = ae[[Nd]] /1000;
Za = Zae[[Nd]];
Zb = Zbe[[Nd]];
];
and this works. But then I try using the same here:
frq1 = 50 10^6;
frq2 = 1000 10^6;
Nfrq = 95;
frq = Table[0, {Nfrq}];
for [Nf = 1, Nf < Nfrq + 1, Nf++,
frq[[Nf]] = frq1 + (Nf - 1) (frq2 - frq1)/Nfrq;
];
and it does not work. Any idea why this does not work?
Dwight, the For command must use uppercase F. Secondly, the nf<=Nfrq+1 yields a value of 11 but frg has a maximum of 10 elements. This requires nf<Nfrq + 1 or nf,<=Nfrq. Hope this helps. Regards,
-Ed