43,944 reputation
568177
bio website
location
age
visits member for 2 years, 8 months
seen 5 hours ago

Jan
28
comment Applying a general formula
Alexander, while the fancy 2D typesetting looks good in the Mathematica front end, as you can see it doesn't translate to text very nicely. May I suggest you write your expression in one-dimensional InputForm, e.g. instead of $\sum _{i=1}^n x_i$ use Sum[Subscript[x, i], {i, 1, n}]. Personally I would also use downvalues instead of subscripts, e.g. instead of Subscript[x,i] use x[i].
Jan
27
comment Manipulate: After Changing view of a Graphic, the sliders can't be used anymore
BTW this is in Mathematica, not CDF player. The problem seems to be related to MatrixForm - if I remove that the problem goes away.
Jan
27
comment Manipulate: After Changing view of a Graphic, the sliders can't be used anymore
I can reproduce this weirdness with version 9.0.1 on Win7x64. I used the code from Pinguin Dirk's answer here. If I right click on the Graphics3D and select one of the view options (e.g. Front View) it will about 50% of the time make the sliders unresponsive.
Jan
27
comment Sorting lists element by element
@Mr.Wizard, thanks for the reminder. For some reason the stable sort syntax just won't stick in my brain.
Jan
26
reviewed Approve suggested edit on find connectivity
Jan
26
comment Poor CUDALink performance, when calling a kernel multiple times
There's no easy way! AFAIK there is no publicly available documentation for the CUDALink DLL, you are expected to use the CUDAFunction interface and not worry about the details. If you want to dig into the Mathematica code behind CUDAFunction you can use the "Spelunking" package here. However, it will be a lot of guesswork and experimentation to get anything working. It might end up being easier to write something in C and call that, or (if possible) change your algorithm to do a few large calculations rather than many small ones.
Jan
26
answered Sorting lists element by element
Jan
26
comment Recognize simple shapes in an image and color them randomly?
@rasher, it's probably easier to modify the component matrix than the color function. e.g. Colorize[Mod[863 #, 231], ColorFunction -> "Rainbow"] &
Jan
26
comment Mathematica Library
Possible duplicate?
Jan
25
comment Poor CUDALink performance, when calling a kernel multiple times
Just running the CUDA kernel 1000 times takes about 0.06s on my PC (Do[CUDALink`Private`cLaunchKernel["Double"][], {1000}]) compared to 0.9s for Do[fun[gpuC, gpuA, gpuB], {1000}]. The overhead is validity checks on the function arguments and options, calculating the grid size, and multiple calls to the CUDALink DLL to set the cubin binary, the kernel function, function arguments and the block and grid sizes, then launch the kernel and finally deal with the output.
Jan
25
comment Labelling objects in a picture with numbers
IMO it would be cleaner not to wrap the centroids in the extra list in the first place (by removing the list braces from {"Centroid"}) and then just use Text @@@ cenData
Jan
25
comment Labelling objects in a picture with numbers
@andy, you can edit your question (click the edit button beneath the question) and simply copy and paste your code in. To format it as a code block you select the code and click the "Code Sample" button (looks like {}). There is more detailed formatting help here and general advice on asking a good question here
Jan
24
comment Fast method for combining two lists
You can get a bit more speed by rearranging the expression to remove one of the multiplications: vL (v1 - v2) + v2, and then a bit more by using Subtract: vL Subtract[v1, v2] + v2
Jan
23
answered Reading binary strings from file as strings
Jan
22
comment Why are numeric division and subtraction not handled better in Mathematica?
I see similar results to Ymareth on an i5 processor (win7, MMA 9.0.1) - all methods use all 4 cores roughly equally but the multiplication versions run at about 40% CPU with Divide at about 70%
Jan
22
comment Coloring the points in a ListPlot with the value of another function
@Edouard, for a large number of points I would suggest using a gradient color scheme, for example: c = ColorData["Rainbow"] /@ (Range[25]/25);
Jan
22
answered neighbor swapping distance between two strings
Jan
20
comment Better way to plot multiple discrete PDFs?
In my opinion there is a problem with this plot, in that the steps occur at integer values on the k axis. e.g. the value of the magenta curve at k=1 is both 0.12 and 0.27. Unless you know the code that was used to create the plot, there is no way to tell which is the correct value.
Jan
20
comment How do I fill the area from 0 to pi in my Sine wave and in the process get the area value?
@AliGajani, I think you are looking for the indefinite integral Integrate[Sin[x], x]. You may benefit from reading the documentation for Integrate, perhaps start here: How to Do an Integral
Jan
20
answered Faster list duplicate 'limiter'