After solving a function I get a list as a set of rules. {{x -> 0}, {x -> 0, x -> 10.}, {x -> 0, x -> 5.}, {x -> 0, x -> 3.33333}, {x -> 0, x -> 2.5}, {x -> 0, x -> 2.}, {x -> 0, x -> 1.66667}, {x -> 0, x -> 1.42857}, {x -> 0, x -> 1.25}, {x -> 0,x -> 1.11111}, {x -> 0, x -> 1.}
. The first entry in the list has a single rule while the all other entries have 2 rules. It might be possible that some entries have 3 rules also. What I need to do is replace all the rules by its values. So the resulting list should be like {{0},{0,10},...}
. These are like values of y. Values of x are Range[0,1,0.1]
.
To plot them, if I had list of numbers rather than a list of rules I could first extract first list as listy1 = y[[;;,1]]; listy2 = y[[;;,2]]; p1 = ListLinePlot[]; p2 = ListLinePlot[]; Show[p1,p2]
. This also has a issue that whenever I will run a command list2 = y[[;;,2]]
, it will fail because the second element of first row does not exist.
Please tell how to do deal with these problems.