SOLVED: Thanks to Daniel below, I should index as expected as [[All,All,1] for er etc. My mistake came as I was trying to index from 0, which Mathematica does not like!
I've spent a while reading other posts on this so hopefully it's not a duplicate as I couldn't find the answer.
I have a function which calculates 3 vector components of the electric field {er,e$\phi$,ez} at a particular point in 2D space, and wish to calculate that over a plane {r,$\phi$}. My function returns {er,e$\phi$,ez} for a given pair of inputs, and the results are put into a ParallelTable
EFieldIn[r_, \[Phi]_, ....]:=Module[{.....},
... ;
Return[{er, ep, ez}];
];
Ein = ParallelTable[EFieldIn[r, \[Phi], ......, {r, 175 10^-9, 500 10^-9,dr}, {\[Phi], -\[Pi], \[Pi], dp}];
I've omitted the other arguments and sections of code for clarity as they're not relevant.
This produces a table {{{er,ep,ez},{er2,ep2,ez2},......,{erN,epN,ezN}}}
My question is about how to index this to get the three NxN arrays of er e$\phi$ and ez independently? Everything I have tried so far using what I know of normal indexing of a 1 and 2D list has not been working.
{er,ep,ez}
). First useCatenate
to get a list of tuples, then applyTranspose
to give you three lists with the length of N. $\endgroup$