Hot answers tagged

6

This is due to the interpolation. If you turn off the interpolation by InterpolationOrder -> 0 you will see symmetric plot. data = Flatten[Table[{x, y, If[x == y, 1, 0]}, {x, 0, 1, 1/10}, {y, 0, 1, 1/10}], 1]; dataR = data; dataL = data /. {x_, y_, z_} :> {-x, y, z}; data0 = Join[dataL,dataR] ListDensityPlot[data0, ...


5

The rectangle (0,0), (0.5,0), (0,1),(0.5,1) should be covered, however it is not. The 29 rectangles in your original tabla cover the region 1/31 <=b < 1/2 && 0 <= a <= 1. ClearAll[tabla] tabla[n_] := Table[{1/(k + 1) <= b && 1/k > b}, {k, 2, n, 1}]; You can specify a large enough value for PlotPoints to see all 29 ...


4

Wrap the call to the function that is likely to generate errors and return unevaluated in a Check expression. In the case of correct execution, Check will pass through the value returned by its argument; in case of an error, it will return an expression of your choice. This "failure indicator" won't trigger recalculation, and can be made very recognizable ...


2

A not-that-fast solution could be easily written: f[dat_, part_] := Outer[SortBy[#, -# &] & /@ Internal`PartitionRagged[##] &, Permutations@dat, part, 1, 1]; PlanePartitions[n_] := Module[{pt = IntegerPartitions@n, inp}, inp = {#, IntegerPartitions@Length@#} & /@ pt; Select[Flatten[f @@@ inp, 2], With[{t = PadRight[#, {n, ...


2

There was no problem exporting at the correct frame rate when I initially tried it with a small number of test frames, given that the code in the question doesn't produce any actual frames. However, I now tried again with a large table of frames to replicate the specific number of 979 frames in the question. Indeed, in this case the resulting movie has the ...


1

Just make a function yourself: tensor[d_, r_] := Outer[t, ##] & @@ ConstantArray[Range[r], d]


1

How about: rankTensor[ranks_] := Module[{x}, Fold[Table[#1, #2] &, x, ranks] /. x :> RandomReal[]] Then In[19]:= rankTensor[{2, 3, 4}] Out[20]= {{{0.604317, 0.417602}, {0.66135, 0.40658}, {0.34705, 0.830708}}, {{0.941604, 0.286638}, {0.330288, 0.176155}, {0.516489, 0.395396}}, {{0.881244, 0.568469}, {0.4826, 0.13277}, {0.243761, 0.430784}...


1

After one week of constant trial and error, I discovered that I only have to use the attribute HoldAllComplete instead of HoldAll: SetAttributes[mySum, HoldAllComplete]; mySum[arg_, {index_Symbol, limits___}] := Block[{index, evaluatedarg}, Print["debug msg 1"]; evaluatedarg = arg; With[{replaceevaluated = evaluatedarg}, mySum[replaceevaluated,...



Only top voted, non community-wiki answers of a minimum length are eligible