45,371 reputation
572180
bio website
location
age
visits member for 2 years, 8 months
seen 6 hours ago

Mar
12
comment Why does a variable become real when using the second argument of Dynamic?
FYI you can Spelunk the definitions of BoxForm`RemapVariable and BoxForm`RemapValue, they are indeed kernel functions which do just what you guessed.
Mar
8
comment Improving performance in the generation of random (directed acyclic) graphs
@rasher, the List@@ is there to unpack at level 1, so that a and b will remain packed. See this for discussion.
Mar
7
comment combining manipulate with “static” plot
Look up Show for combining graphics, and PlotRange for fixing the range of plots
Mar
7
comment 2D Fourier transform of a table - ArrayPlot issue
RotateLeft can rotate rows and columns in one go: RotateLeft[ft, {hshift, wshift}]
Mar
4
comment Plot Matlab icon
I must admit I ignored the stuff about how they actually created the logo, finding the finite difference solution more interesting!
Mar
3
comment GatherBy and two conditions
You can gather into nested sublists using GatherBy[list, {#[[3]] == 6 &, Last}]
Mar
3
comment For loop in Mathematica
I fixed your code using Halirutan's awesome browser script. Generally it is simpler just to avoid using Greek letters in code you post here.
Mar
2
comment How can you convert a matrix back into a list of lists?
possible duplicate of Why does MatrixForm affect calculations?
Mar
2
comment How to fill a whole rectangle with text?
Looks like a bug to me. I used StringTake[ExampleData[...], n] and varied n with a Manipulate. For some string lengths the font is magnified as expected, for others it isn't.
Mar
2
comment Re-arranging / selecting of a data table very slow in For loop
It's slightly quicker, at least on my PC with this data, to just use Mean /@ GatherBy[test, First]
Mar
2
comment How can I add drop shadows and specular highlights to 2D graphics?
@rm-rf, thanks. I'll put the code onto github.
Mar
1
comment Is there a way to “hold” prefix / infix / postfix notation?
Does Interpretation[Postfix[foo // bar], foo // bar] work?
Feb
28
comment Plot Matlab icon
@xzczd, LaplacianFilter implements the Discrete Laplace Operator with a convolution. The second argument of LaplacianFilter just determines the size of the convolution kernel. By setting this to 1 the smallest possible kernel is used (3x3) which keeps lapMatrix as sparse as possible. If you use a larger kernel you will get a bit more accuracy but slow down the eigenvector calculation.
Feb
26
comment Something faster than Do loops with AppendTo
@rasher, I assumed that the v1 given in the question was an example and it would not generally be Range[n], but it's a good point worth mentioning.
Feb
25
comment Mathematica averaging a big list of large images
Why 0 set[[1]] and not just 0 ?
Feb
25
comment Defining Piecewise Functions in Modules
In this example you could reduce the problem to something like myfunc[] := Module[{rhs, f}, rhs = 2 x; f[x_] := Evaluate[rhs]; f[5]] This is small enough that you could use Trace[myfunc[]] to see exactly what is happening.
Feb
25
comment Defining Piecewise Functions in Modules
It's a good idea to reduce your problem to a Minimal Working Example that people can copy and paste into Mathematica to work on. This has 3 benefits, firstly it makes it easier for people to help you, secondly it makes the question and answers more useful to future visitors who might have the same problem, and thirdly the process of stripping the code down to the core of the problem will often help you to solve it yourself.
Feb
24
comment PDF for Gamma Distribution not what I expect
You're using a shape/scale parametrization (and getting the correct result). Most likely R is using a shape/rate parametrization. Try alpha = 3, beta = 1/5 to get the PDF you are looking for.
Feb
22
comment Extract the left channel from an mp3 file
The supported formats for sound import are here
Feb
22
comment Extract coordinates from a polygon
It looks like your poly expression contains a list of length 2 at a higher level than the individual coordinate pairs that you are trying to reach with Cases. Try making the pattern inside Cases more specific, e.g. {_Real, _Real}