Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #11396
| From | Alexei Boulbitch <Alexei.Boulbitch@iee.lu> |
|---|---|
| Newsgroups | comp.soft-sys.math.mathematica |
| Subject | Re: working with nested lists |
| Date | 2012-08-17 08:18 +0000 |
| Message-ID | <k0kuo4$6ds$1@smc.vnet.net> (permalink) |
| Organization | Time-Warner Telecom |
I'm trying to apply a transformation to a every element in a nested list. The issue is that each sub-list has a different length
Example of the list:
myList={{{-33.355 Degree, 278.265}, {-33.486 Degree,
155.871}, {-60.650 Degree, 27.534}},
{{-38.418 Degree, 148.054}, {-165.173 Degree, 70.342}}};
This is what I am trying and does not work:
Do[
Table[{myList[[k, i, 1]], myList[k, i, 2]] (-1)/Sin[myList[[k, i, 1]]]}, {i,
Length[myList[[k]]]}], {k, Length[myList]}]
Any tips?
Is this:
myList = {{{-33.355 Degree, 278.265}, {-33.486 Degree,
155.871}, {-60.650 Degree, 27.534}}, {{-38.418 Degree,
148.054}, {-165.173 Degree, 70.342}}};
Table[Table[{myList[[k, i, 1]],
myList[[k, i, 2]] (-1)/Sin[myList[[k, i, 1]]]}, {i,
Length[myList[[k]]]}], {k, Length[myList]}]
{{{-0.582155, 506.098}, {-0.584441, 282.512}, {-1.05854,
31.5887}}, {{-0.670521, 238.261}, {-2.88281, 274.879}}}
What you are after?
Alexei BOULBITCH, Dr., habil.
IEE S.A.
ZAE Weiergewan,
11, rue Edmond Reuter,
L-5326 Contern, LUXEMBOURG
Office phone : +352-2454-2566
Office fax: +352-2454-3566
mobile phone: +49 151 52 40 66 44
e-mail: alexei.boulbitch@iee.lu
Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread
Re: working with nested lists Alexei Boulbitch <Alexei.Boulbitch@iee.lu> - 2012-08-17 08:18 +0000
csiph-web