Tag Info

New answers tagged

1

Just for variety: t = Table[x, {x, 0.4, 0.8, 0.2}]; t2 = Table[x, {x, 0.4, 0.8, 0.2}]; res = {{{6.17743*10^-21, {w -> 0.339965, r -> 0.223645, p2 -> 1.33362, pw -> 1.72372}}, {1.90741*10^-25, {w -> 0.542223, r -> 0.371844, p2 -> 1.64076, pw -> 2.02472}}, {5.71176*10^-24, {w -> 0.643134, r -> 0.450457, ...


1

result = {{{6.17743*10^-21, {w -> 0.339965, r -> 0.223645, p2 -> 1.33362, pw -> 1.72372}}, {1.90741*10^-25, {w -> 0.542223, r -> 0.371844, p2 -> 1.64076, pw -> 2.02472}}, {5.71176*10^-24, {w -> 0.643134, r -> 0.450457, p2 -> 1.93086, pw -> 2.22915}}}, {{7.33982*10^-22, {w -> 0.311135, ...


0

Let tab be the results table: ListPlot[{t /. #2, #1} & @@@ tab]


0

dt = Quiet@ Table[{Last@@#2, #1}&@@ FindMaximum[l[t, i], {t, 0.4}], {i, 3, 501, 2}]; ListPlot[dt] You could also use: dt = Quiet@ Table[{Last @@ #, #2} & @@ Reverse@FindMaximum[l[t, i], {t, 0.4}], {i, 3, 501, 2}];


0

And still another method is ListPlot[Cases[results, {z1_, {Rule[_, z2_]}} :> {z2, z1}, Infinity]]


0

That's like a breeze: result = {{0.148148, {t -> 0.333333}}, {0.204148, {t -> 0.384677}}} Flatten /@ result /. x_Rule :> x[[2]] // ListLinePlot PS: Because there are only 2 points better using ListLinePlot for illustration


2

results= Table[FindMaximum[l[t, i], {t, 0.4}], {i, 3, 501, 2}] ListPlot[Transpose[{t /. results[[All, 2]], results[[All, 1]]}]] Explanation results[[All, 1]] takes all the y values t /. results[[All, 2]] replaces the rules creating a list of all the t values Transpose to have it ready for ListPlot


0

Or this: lst = {{a, b}, {b, a}, {a, b, c, d, e}, {e, d, c, a, b}}; DeleteDuplicates[Sort/@lst] (* {{a, b}, {a, b, c, d, e}} *)


3

Perhaps something as simple as data = {{a, b}, {b, a}, {a, b, c, d, e}, {e, d, c, a, b}}; Union[Sort /@ data] {{a, b}, {a, b, c, d, e}}


1

Like this? lst = {{a, b}, {b, a}, {a, b, c, d, e}, {e, d, c, a, b}}; DeleteDuplicates[lst, Sort@#1 == Sort@#2 &] {{a, b}, {a, b, c, d, e}}


0

Here are some different ways you could do this. I specify a G just to suppress errors. G = {"a", "b", "c"} tab = Table[{G[[i]], G[[j]]}, {i, 1, 3}, {j, 1, 3}]; Flatten[tab, 1] Join @@ tab Map[Part[G, #] &, Join @@ Outer[List, Range[3], Range[3]], {2}] Map[G[[#]] &, Tuples[Range[3], 2], {2}] All yield: {{"a", "a"}, {"a", "b"}, {"a", "c"}, {"b", ...


1

Total takes a second argument which specifies the levels to sum together. In your case you want to preserve the lowest two levels so you need to total down to level -3: Total[Table[m, {k, 10}, {j, k}, {i, j}], -3] This will work if you have more indices.


0

result = ReplacePart[first, Thread[Rule[Position[first, a], t]]] ListPlot[Transpose[{t, result}]]


3

first = {1 + a, 2 + a, 3 + a, 4 + a}; t = {0, 1, 2, 3}; MapThread[#1 /. a -> #2 &, {first, t}] (* {1, 3, 5, 7}*) or #[[1]] /. a -> #[[2]] & /@ Transpose@{first, t} (* {1, 3, 5, 7}*)



Top 50 recent answers are included