penguin77
• Member for 6 years, 10 months
• Last seen more than 1 year ago
• Antarctica, Icy Hills, 5, Penguin Blvd

You may consider this, rl= (a_. Sum[b_. Subscript[x_, i_], {i_, i0_: 1, n_}]) :> Sum[(a b) Subscript[x, i], {i, i0, n}]; exp = Sum[2/9 Subscript[x, i], {i, 1, n}] + 2 Sum[1/9 Subscript[x,...

You may consider spec = Sequence @@ (Span @@ # & /@ rect); Part[t, spec] or t[[spec]] This would lead to: With[{spec = Sequence @@ (Span @@ # & /@ rect)}, t[[spec]] = Map[f, t[[spec]]...

You may consider this: DateListPlot[{{1, 1, 2, 3, 5, 8, 11}, {5, 8, 9, 6, 2, 4, 7}}, {2013,1,1}, Joined -> True, CoordinatesToolOptions -> {"DisplayFunction" -> (DateString@First@# &)}...

You may consider this MapIndexed[Times, #] & /@ {{a, b, c}, {e, f, g}} // Plus @@ # & (* {{a + e}, {2 b + 2 f}, {3 c + 3 g}} *) MapIndexed applies a function (in your example Times to ...

Append has no side effect You may try AppendTo a = {x^2 + y^2 == 1}; AppendTo[a, x + y == 0] Solve[a, {x, y}] resulting in (* {{x -> -(1/Sqrt[2]), y -> 1/Sqrt[2]}, {x -> 1/Sqrt[2], ...

Instead of using a for loop, you may consider Union straight away: Union[RandomInteger[10, 3], RandomInteger[10, 3]] (*{0, 4, 6, 9, 10} Obviously result will different for each run *)

Creating a data set dset with date values for the period of 5 months starting on a Sunday associated with random integers ( DayName @ {2015, 04, 12} (* Sunday*)). dset = DateRange[{2015, 04, 12}, ...

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 ...

Here we go using FoldList list = Array[{Subscript[a, #], Subscript[b, #]} &, {3, 1}] // Flatten /@ # & (* or Flatten[#,1]& doing the same, but faster *) FoldList[f[#, Sequence @@ #...

I trust, you have figured out the response to your "why" question by reading the comments. For your convenience here some very common ways for selecting elements from a list. Cases[{1, 2, 3, 4, 5}, ...

Do you mean this ? n = 5; getA[kappa_] := Table[2*Cos[(2*π/n)*(Abs @(i - j))*kappa], {i, 0, n-1}, {j, 0, n-1}] getA[3] //MatrixForm You may post the expected result from your Python code in ...

To demonstrate evaluation in parallel computing on different number of kernels 1)Default list of kernels run for parallel computing \$ConfiguredKernels (*("<<1 local kernels>>", ...

I would suggest to take out of Do any evaluation that need to be done only once and make sure to clear variables between successive runs. Clear[L, LL, k, config] L = 50; LL = L!; Do[t = LL/(k! (L -...

You may consider moving the variables used for the dynamic clock into a dedicated context Dynamic[{clockd, clockh, clockm, clocks} = List @@ DateDifference[Now, DateObject[{2015, 5, 18}],...

M9 under Windows 7, Intel Core i7 970. 24 GB RAM, Import without any problem. Alternatively you can read the file as a stream. str = OpenRead["z:\\temp\\omni_m_all_years.dat"] ReadList[str, Record]...

You may consider this to produce same result as your code: n = 15; s = 11; m = 3; ip = IntegerPartitions[n, {m}]; Select[ip, Max @@ # < s && DuplicateFreeQ@# &]

Less elegant than DeleteCases, however an alternative: exp = {First -> {a -> "aaaa", b -> "bbbb"}, Second -> {c -> "cccc", d -> "dddd", e -> Missing["NotAvailable"], f -&...

If your are looking for a Binary tree than this may work for you: fnBTree[n_] := CompleteKaryTree[Sequence @@ # , VertexLabels -> "Name"] & /@ Join[{{1, 1}, {2, 1}}, Table[{i + 1, 2}, ...

Illustrating Rasher's suggestions for your convenience with some data set. Just create anything for the sake to demonstrate counting: dset = ElementData[#, "SoundSpeed"] & /@ ElementData[] // ...

Replace PlotLegends-> Automatic with Barlegend combined with option LegendFunction PlotLegends -> BarLegend[Automatic, LegendFunction -> (ScientificForm[# // N] &)]]

No erratic behavior on my computer M9. However a simple workaround could be considered that achieves its purpose. Workaround for moving a symbol from one context to another can be achieved by: For ...

I believe it is important to get a fundamental understanding of what Pure Functions are that goes beyond the understanding using of a syntax. Hereafter an non-exhaustif summary of a few key ...

In your first line of your code the variable a is assigned the string ["/Users/pedrofonsecazuccolo...." and then trying to use the Part function that is a[[1,Range[1,19],2]] which indeed is a wrong ...

Example 3 is very different from example 1 and 2. Example 2 is a function with 4 arguments whereas example 3 has two arguments, first argument is a list with three elements{a_,b_,c_} and 2nd ...

One way of getting this to work is by using the Locator as a Control of Manipulate. For the convenience of easier spotting the replaced pixel I have cropped and magnified the image. image = ...

uuhahh, there is an important big difference. Grid returns a Grid object whereas GraphicsGrid returns an Image. Therefore you will be able to apply all Image functions to GraphicsGrid as a whole, ...

Here the code using ListAnimate data1 = {{{0, 2}, {1, 4}}, {{0, 2}, {1, 8}}}; data2 = {{{0, 3}, {3, 4}}, {{1, 5}}}; Show /@ Transpose @ (Table[ ListLinePlot[#[[n]], PlotRange -> {0, ...

Yes you can do it using the option IntializationCell, moreover there are complementary options for controlling its behavior. Here is the documentation on how to achieve it https://reference.wolfram....

Easy work around without needing to figure out URL Remove all symbols used for retrieving example data from the Context Remove["DataPacletsExampleDataDump*"] This will permit you still to ...