Tag Info

Hot answers tagged


The comments by both Michael E2 and J. M. ♦ are already an excellent answer, so this is just my attempt at summarizing. Undocumented means just what it says: there need not be any reference pages or usage messages, or any other kind of documentation. There are many undocumented functions and if you follow MSE regularly, you will encounter them often. Using ...


It seems like RandomReal[1., 2] is automatically a packed array, whereas {1., 2.} is not. Notice; (Outer[Times, list1, Developer`ToPackedArray@{1., 2.}];) // AbsoluteTiming // First (* 0.032425 *) whereas (Outer[Times, list1, {1., 2.}];) // AbsoluteTiming // First (* 0.542086 *) Also: list1 = Developer`FromPackedArray@RandomReal[1., 1000000]; ...


How should I know the correct order of arguments without trying several times? You can't, usually. A lot of the undocumented usage that you see on this site will have been worked out by trial and error. Sometimes it is fruitless - I have explored plenty of interesting-sounding internal functions and got nowhere. Are there detailed usage information of ...


Quick fix: Plot[Sort@m2[x], {x, -1, 1}]


I'm kicking myself for not thinking of ybeltukov's answer, but here's mine. It's another (less efficient) way of sorting, but this has the advantage of preserving colorings. pts = Table[m2[x], {x, -1., 1, 1/32.}]; Do[ pts[[i]] = MinimalBy[ Permutations[pts[[i]]], Norm[Abs[pts[[i - 1]] - #]] & ][[1]], {i, 2, Length[pts]} ]; ...


I'm not sure whether this works on more complex situations, but if you just define it as a function, it appears to give what you are looking for: m[x_] := Eigenvalues[M] Plot[m[x], {x, -1, 1}]


The question is not clear. However, I will state the assumptions and try to answer. Assumption: Kinv is the inverse of the matrix K When you refer to KK you meant the matrix K Answer: The matrix K is of dimension 12X12, which can be checked using Dimensions[K]. The inverse of the matrix will also be of dimension 12X12. While taking the dot product, ...

Only top voted, non community-wiki answers of a minimum length are eligible