Reputation
15,978
Next privilege 20,000 Rep.
Access 'trusted user' tools
Badges
2 44 76
Newest
 Nice Answer
Impact
~258k people reached

Jul
28
comment Is there a function for nearest power of 2 in Mathematica like nextpow2 in MATLAB?
Ceiling[Log[2, #]] &
Jul
25
comment Ordering oscillators with negative powers: Infinite loops
Can't you try to isolate which rule is the problem? It seems unlikely that anybody will sit down and work it out from your mass of patterns! Try to put yourself in the answerer's position.
Jul
25
comment Ordering oscillators with negative powers: Infinite loops
Can you isolate and post the bit of code that results in an infinite loop? I don't see why normal ordering according to your prescription would result in an infinite loop.
Jul
23
comment Is there a way to recreate the typical Red/Blue-Postereffect using Mathematica?
@RahulNarain truth be told, I did try improving them and got bored after 20s. So I understand you (but I'll hold on to those sweet upvotes anyway)
Jul
23
revised Is there a way to recreate the typical Red/Blue-Postereffect using Mathematica?
added 42 characters in body
Jul
23
revised Error message: Coordinate index 0 is out of range for the enclosing GraphicsComplex
added data to question
Jul
23
comment Is there a way to recreate the typical Red/Blue-Postereffect using Mathematica?
@eldo the comment above was for you
Jul
23
comment Is there a way to recreate the typical Red/Blue-Postereffect using Mathematica?
complaints should be addressed to @RahulNarain who came up with the colours. I'm just here to collect the votes :)
Jul
23
answered Is there a way to recreate the typical Red/Blue-Postereffect using Mathematica?
Jul
23
comment Is there a way to recreate the typical Red/Blue-Postereffect using Mathematica?
Colorize[image, ColorFunction -> cfunc] is probably what you want, although coming up with the appropriate cfunc is the trick.
Jul
22
comment Is there a list of Octave functions mapped to the related Mathematica one?
@RunnyKine not baroque enough
Jul
22
comment Is there a list of Octave functions mapped to the related Mathematica one?
The 3rd alternative for ones is a bit like this function for obtaining $2^n$: powerof2[n_] := Length@ReplaceRepeated[{0}, (0 -> Sequence[0, 0]), MaxIterations -> n] // Quiet
Jul
22
comment Is there a list of Octave functions mapped to the related Mathematica one?
I understand; like I said, you might have better luck looking for matlab-mathematica tables. Also, a more direct translation of ones(n) probably would be ConstantArray[1, n]. However, that creates a list (or vector) of Integer entries, which means that if you try to do any arithmetic with it it will be done with exact numbers. This is much slower than with reals. This sort of booby traps are everywhere in mma.
Jul
22
comment Is there a list of Octave functions mapped to the related Mathematica one?
You might look for matlab-mathematica functions. But keep in mind that, as a language, mathematica is very different from matlab or octave.
Jul
22
comment Symbolic solution(s) to generalized Heat equation
@chris Yes that would be useful. Just like you can use mma now rather than carry around Gradshteyn-Ryzhik or Abramowitz-Stegun. Great idea.
Jul
22
comment Symbolic solution(s) to generalized Heat equation
Maybe because it's more of a mathematical problem than a Mathematica problem. I'm not sure how I'd go about finding analytical solutions with mma (but maybe someone else knows).
Jul
22
comment Get the last line from each of a large number of files, transform them, and write all results to a single new file
You can even make a palette! (OK I guess it won't work with hundreds of files, but self-promotion is self-promotion)
Jul
22
comment Symbolic solution(s) to generalized Heat equation
While I didn't vote to close it, I suppose the reason is that you're asking why WRI does not provide functionality X. It's not something people are likely to be able to answer here. Having said that, maybe the reason they don't provide Green's function solutions is that those are convolutions and the kernel depends on the geometry, for example (eg consider the solution of the 1d heat equation in $[-1,1]$). I don't really know though.
Jul
22
comment How can I prevent a compiled function from using uncompiled evaluation?
@JasonB OK, if you only ever run it headless then you won't see it. For what it's worth, what I do is write code on my laptop, make sure it works on small example, then send the whole thing to bigger machines. But if you can't, then the solutions here might be the only way (I do have it in my init.m as you said).
Jul
21
comment How can I prevent a compiled function from using uncompiled evaluation?
@JasonB Are you aware of SetSystemOptions["CompileOptions" -> "CompileReportExternal"->True]? If not, it might be useful in your case (it warns you at compile time if you reference an external variable). I might have misunderstood the problem you are trying to solve, though.