0
$\begingroup$

I have a 1000X6 table, where in each row the first three columns are dependent on the second three. I then make smaller tables of 1000X2 from these first three columns and basically ListPlot the τ s. Here's the code:

FullTab1 = Table[{Subscript[τ, extra], Subscript[τ, mix1], 
 Subscript[τ, mix2], u, Subscript[ϕ, 1], Subscript[ϕ, 2]} 
/. {Subscript[ϕ, 2] -> Subscript[ϕ, 1] - u^2/(8 Subscript[ϕ, 1]^2)}
 /. {Subscript[ϕ, 1] -> (RandomReal[{0.5, 1}])*Exp[I*RandomReal[{0, 2*Pi}]], 
u -> (RandomReal[{0.001, .1}])*Exp[I*RandomReal[{0, 2*Pi}]]}, {i, 1, 1000}]

Smtabext = Table[{Re[FullTab1[[i, 1]]], Im[FullTab1[[i, 1]]]}, {i, 1, 1000}]
Smtabmix1 = Table[{Re[FullTab1[[i, 2]]], Im[FullTab1[[i, 2]]]}, {i, 1, 1000}]
Smtabmix2 = Table[{Re[FullTab1[[i, 3]]], Im[FullTab1[[i, 3]]]}, {i, 1, 1000}]

ListPlot[Smtabext]
ListPlot[Smtabmix1]
ListPlot[Smtabmix2]

So here's the question. The values of the first column of FullTab1, i.e. Subscript[τ, extra] , should all have imaginary part equal to 1, but not all of them do. I'm only interested in the rows that do satisfy the Im[#1]=1 condition. I would like to make my 'Smtab' s only consistent of these rows. Any insight on how this could be done?

I have tried If, For, Select, Do, and a few other commands but I'm not sure if I'm using them right. Any help would be appreciated.

$\endgroup$
  • $\begingroup$ Welcome again to Mathematica.SE! I suggest that: 1) You take the introductory Tour now! 2) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Also, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign! 3) As you receive help, try to give it too, by answering questions in your area of expertise. $\endgroup$ – bbgodfrey Feb 26 '15 at 0:26
  • $\begingroup$ As written the first column of FullTab1 contains only the symbol, Subscript[\[Tau], extra], and no complex numbers, because no values have been assigned to Subscript[\[Tau], extra]. $\endgroup$ – bbgodfrey Feb 26 '15 at 0:34
  • $\begingroup$ the [Tau] 's are complicated functions based on [Phi]s and u. and they give numerical values. $\endgroup$ – AM_ Feb 26 '15 at 0:36
2
$\begingroup$

Based on your self-answer I think you want this:

SeedRandom[0]
FullTab1 = RandomComplex[{0 I + 0, 2 I + 2}, {20, 3}];  (* example data *)

sel = Select[FullTab1, Im[First[#]] > 0.9 &];
lgt = Length @ sel;

{ext, mx1, mx2} = Transpose[{Re@sel, Im@sel}, {3, 2, 1}];

ListPlot[ext]
ListPlot[mx1]
ListPlot[mx2]

enter image description here

$\endgroup$
0
$\begingroup$

I found my desired answer. In case anyone needs something similar, I'm posting my code here. If anyone cares to clean it up that would be great because I don't know most shortcut tricks. Here it is:

lgt = Length[Select[FullTab1, Im[First[#]] > 0.9 &][[All, 1]]]

ext = Table[{Re[Select[FullTab1, Im[First[#]] > 0.9 &][[j, 1]]], 
   Im[Select[FullTab1, Im[First[#]] > 0.9 &][[j, 1]]]}, {j, lgt}]
mx1 = Table[{Re[Select[FullTab1, Im[First[#]] > 0.9 &][[j, 2]]], 
   Im[Select[FullTab1, Im[First[#]] > 0.9 &][[j, 2]]]}, {j, lgt}]
mx2 = Table[{Re[Select[FullTab1, Im[First[#]] > 0.9 &][[j, 3]]], 
   Im[Select[FullTab1, Im[First[#]] > 0.9 &][[j, 3]]]}, {j, lgt}]

ListPlot[ext]
ListPlot[mx1]
ListPlot[mx2]

This only plots the 648 out of 1000 entries of FullTab1 , were the imaginary part of First[#1] is 1. (for some reason ==1 was not working, but since I knew the values were either 1 or 0.5, writing >0.9 works for me.)

Good luck!

$\endgroup$

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.