9,531 reputation
1642
bio website
location
age
visits member for 2 years, 7 months
seen 23 hours ago

Mar
14
comment How to get list of duplicates when using DeleteDuplicates?
I just have noticed an upvote on this answer and guessed that was related to this question. I think the fact that a function in matlab gets the information about how many arguments its caller expects from it is very unique and somewhat unusual (are there other languages having this?). My mentioned answer did mimic that behavior by examining the stack, but it's more a hack than a solution. Without that feature, you can of course not expect a function to return different things depending on how many return values the caller expects...
Mar
10
answered Launching external program in background process with ParallelSubmit
Mar
10
comment Launching external program in background process with ParallelSubmit
I think you just need to DistributeDefinitions for runFijiMacro (and potentially other self-defined functions you are using within it). My guess of what happens is that the function is not known in the parallel kernels and they return the unevaluated expression. Only when these are returned to the main kernel with the WaitAll they are evaluated -- sequentially on the main kernel. Search the documentation for ParallelSubmit for DistributeDefinitions to find an example usage and some more details...
Mar
7
answered Fast way to get positions of “boxed” array elements?
Mar
6
comment Merging two held expressions into a held compound expression
@zorank: @@ is a shortcut for Apply. @@@ is a shortcut for Apply[_,_,{1}] that is apply at first level. You'll find details in the documentation for Apply...
Mar
4
answered Merging two held expressions into a held compound expression
Mar
4
comment Why does Plot[Hold[x], {x,0,1}] work?
I would absolutely agree with your guess that it is the internal handling of evaluation control which make these work accidentially. The question remains whether that indicates that these internally do more ReleaseHolds than necessary and whether that is intended or a lack of attention. In any case it seem to not cause much problems, I think?
Mar
2
revised GUI and Dynamic update problems
added missing definition for identity
Mar
2
comment NDSolve with varying PrecisionGoal and WorkingPrecision
I'm not sure but I think that the difference might be that with a higher lower bound NDSolve will try to make an exact match in the x-steps for that value which might result in a slightly different discretization. You can see similar effects with e.g. NDSolve[{y'[x] == y[x] Cos[x + y[x]], y[0] == 1}, y, {x, 0, 5, 30}, WorkingPrecision -> 50, PrecisionGoal -> 50]. See e.g. this answer about the undocumented feature I used here for the x range specification...
Mar
2
answered GUI and Dynamic update problems
Mar
2
comment NDSolve with varying PrecisionGoal and WorkingPrecision
I think this doesn't really do what you expect and the OP intended: if you give a start value for x=0 but ask NDSolve to solve for x=5 to x=30 in the second call it will actually solve from x=0 with high precision but only store the results from 5 to 30 in the result. If you want to only solve with low precision you should instead give the lower precision endpoint result as starting value for the second call, something like: y[0] == SetPrecision[(y /. First@low)[5], 50]...
Feb
11
revised How to make a single-variable out of a NDSolve solution?
added 149 characters in body
Feb
11
comment How to make a single-variable out of a NDSolve solution?
@Sektor: I of course appreciate your politeness :-)
Feb
10
comment Changing package content in batch
I'm actually surprised that my comment seems more relevant than I thought. The problem is that importing and reexporting won't create the same thing as the Mathematica-specific "ascii"-encoding of special characters is only correctly done when using the CharacterEncoding option for Export. Here is an example to play with: ExportString[ImportString["b [Rule] a", "Text"], "Text"]. Of course this is mainly relevant if the package files are generated from a notebook with the auto save as package functionality, otherwise you probably won't expect such characters in a package file...
Feb
10
comment Changing package content in batch
I don't know of any voodoo for the "Text" format, the only thing you should be aware of is the character encoding, the default for text import/export is UTF8 and AFAIK package files typically are interpreted as pure ASCII. As that is a subset of UTF8 it probably only will make a difference if you use non-ascii characters within a package file (which one probably shouldn't do in the first place). I can't recall the details by heart, though, so you might need to look that up yourself...
Feb
10
comment How to make a single-variable out of a NDSolve solution?
@Sektor: thanks for pointing out, I actually changed that line so it shows the data that I was explicitly generating before already, which shows more clearly what I try to point out. Are you aware of the fact that you can in such cases edit the answer yourself? I think such corrections are common and welcomed on this site...
Feb
10
revised How to make a single-variable out of a NDSolve solution?
deleted 35 characters in body
Feb
9
answered How to make a single-variable out of a NDSolve solution?
Feb
6
comment How do we make a negative integer out of a string of a negative number and vice-versa?
... and of course this questions and the corresponding answers might also be of interest...
Feb
6
comment How do we make a negative integer out of a string of a negative number and vice-versa?
I think ToString and ToExpression are what you are looking for. As for your matrix-input, you might look at this question