New answers tagged

4

There are two processes running. The first process is the FrontEnd. The FrontEnd receives your keypresses and renders text and plots. The second process is the Kernel. The Kernel receives commands to perform calculations, stores the states of variables, and does pretty much all the calculating. When you press <Alt>-., the FrontEnd immediately ...


2

Presumably you want a function like Normal that converts all NumberForm expressions to their plain numeric form. This can be done with replacement. expr = {NumberForm[N@Pi, 3], N@E, NumberForm[N@Degree, {1, 5}]} {3.14, 2.71828, 0.02000} expr /. NumberForm[n_, ___] :> n {3.14159, 2.71828, 0.0174533} To catch most number formatting wrappers we ...


0

I think the following also fits the present discussion. Who shadows whom? When you run (*cleanup*) $Context = "Global`"; Quiet@Remove["temp`*", "Global`*"]; (*--*) Global`x = "global"; BeginPackage["temp`"]; temp`x = "temp"; The last line generates the message ...::shdw: Symbol x appears in multiple contexts {temp`,Global`}; definitions in context temp`...


2

f1[n_] = Sum[Fibonacci[i]*(-1)^i, {i, 0, n}]; If you know or suspect the general form of the model model = (-1)^n Fibonacci[b*n + c] + d; data = Table[f1[n], {n, 10}] // Simplify; f2[n_] = model /. ( NonlinearModelFit[data, model, {b, c, d}, n][ "BestFitParameters"] /. x_?NumericQ /; (Abs[x - Round[x]] < 10^-10) :> Round[x]) (* -1 + ...


4

There is probably no package or algorithm that can give you answer in all cases. However, I would like to suggest a semi-automatic solution. I will illustrate it with few examples. Notice, I do not know solutions in advance. Example 1 t[1] = Table[Sum[Fibonacci[3 i], {i, 0, k}], {k, 0, 10}] *({0, 2, 10, 44, 188, 798, 3382, 14328, 60696, 257114, 1089154}*) ...


0

Adding this as an answer since it's too long for a comment. m_goldberg suggests that all pairs must be compared but that's not the full story, consider In[1]:= a == 2 == 3 (* Expect False *) Out[1]= a == 2 == 3 In[2]:= 2 == 3 == a Out[2]= False Doing some experiments it appears that all pairs of arguments are compared in lexicographic order; if two ...


2

It's all explained in the Documentation Center. Equal Subscript[e, 1] == Subscript[e, 2] == Subscript[e, 3] gives True if all the Subscript[e, i] are equal. LessEqual Subscript[x, 1] <= Subscript[x, 2] <= Subscript[x, 3] yields True if the Subscript[x, i] form a nondecreasing sequence. That is, the three arguments in Equal must be equal ...


4

Probably you should use NotebookEvaluate instead of SelectionEvaluate. According to the Documentation, By default, NotebookEvaluate evaluates the cells of a notebook in the same way that Get evaluates the lines of a package file. For example try: nb = CreateDocument[ExpressionCell[Defer[Pause[10]], "Input"]]; NotebookEvaluate[nb] Print["!"] The ...



Top 50 recent answers are included