45,731 reputation
572182
bio website
location
age
visits member for 2 years, 9 months
seen 4 hours ago

Nov
8
comment TrigExpand Idiosyncracies
I assume that somewhere inside TrigExpand the pattern Sin[_]^2 f_[_] leads to different transformation rules according to whether f is a trig function or not. You have simply found a case where one of those transformations gives a result which a human mathematician would discard as inelegant.
Nov
7
comment Matrix multiplication
Yes I figured the question was more about the memory usage than the specific example, that's why I posted a comment instead of an answer. All I can really say about the speed is that I know that Dot is super-optimised for packed arrays, far far quicker than the equivalent number of arithmetic operations. I expect @ybeltukov or @Szabolcs could give a more knowledgeable explanation.
Nov
7
comment draw part of parabola using graphics
@user2485710, Fit does least-squares fitting. There will be plenty of curve fitting libraries for C if you google it. For this specific case it's overkill in fact, because there is an exact solution for the quadratic passing through 3 points. I just used Fit because it's quick and easy to do it that way in Mathematica.
Nov
7
comment Dynamic Infinite Loop
I'm not completely sure what you are trying to do, but you probably need to add TrackedSymbols :> {n, f1, f2} to the Dynamic.
Nov
7
comment Matrix multiplication
Try this instead w = First@Transpose[v]; f = Array[Cos[#1 #2] &, {dim, dim}]; u = Transpose[w].f.w; result = u + Transpose[u];
Nov
7
comment draw part of parabola using graphics
@ubpdqn, I wouldn't worry about it. Ugly code that works is still code that works :-)
Nov
7
comment Matrix multiplication
It seems to me that t = Total[v]; u = Transpose[t].t; result = u + Transpose[u]; will give the same result in a fraction of the time.
Nov
7
comment Glitch in Filling?
Seems to be related to the last point of the first line being lower than the second to last point of the second curve. Try this Manipulate[ ListLinePlot[{{10, 10, a}, {b, b, 0}, {0, 0}}, Filling -> {1 -> {{2}, Brown}, 2 -> {{3}, Gray}}, PlotRange -> {{1, 3}, {0, 11}}], {{a, 7}, 0, 10}, {{b, 5}, 1, 9}]
Nov
2
comment Negative Infinity limit
As Sjoerd says, the expressions are not equivalent. You have mapped x to Exp[x] and then also multiplied by Exp[x]. Voting to close as a trivial error.
Nov
2
comment Integrating elements from matrix
It's great that you included your code, but please add more description about what you are trying to do. It's hard to understand an algorithm by looking at code which fails to implement it.
Oct
31
comment Why does the documentation call functions “pure”?
@Nasser, I think your comment would make a good answer.
Oct
30
comment Using FindFit to return a list of possible best fits
A single example of the generic class would be better than nothing! Without one, anyone wanting to help you must first invent a function and some data which exhibits this issue with FindFit. People are less likely to tackle your problem if they have to invest extra time just to get started.
Oct
29
comment Raster to Image conversion problem
+1 A nice bit of detective work. I think you are correct about the optimisation. If you set SetSystemOptions["ImageProcessingOptions" -> {"Verbose" -> True}] you get some debug output referring to "fast conversion".
Oct
27
comment how to speedup subpixel registration
To extract the transformation directly from ImageAlign, use the secret option ImageAlign[i0, small, "FindGeometricTransformOutputQ" -> True]
Oct
27
comment I'm trying to make an internet radio alarm clock
@belisarius, ah okay. I didn't know that. Sorry for the false hope, user12876
Oct
26
comment I'm trying to make an internet radio alarm clock
Have you seen RunScheduledTask ?
Oct
26
comment Findfit doesn't provide reasonable results when fitting a complex function
This question appears to be off-topic because the fit found by FindFit is perfectly reasonable
Oct
26
comment FindFaces: how to improve the results of the face recognition feature
@user15961, it's very strange. I'm sorry but I have no clue what could be causing it! There should be no difference between using the Automatic option and explicitly specifying the same file.
Oct
26
comment FindFaces: how to improve the results of the face recognition feature
@user15961, what does this give? Cases[DownValues @ Image`PatternRecognitionDump`ffOpenCV, _FileNameJoin, -1]
Oct
26
comment FindFaces: how to improve the results of the face recognition feature
@user15961, I'm not sure. Does the file exist at that location?