Tag Info

New answers tagged

1

This seems like more of a feature request for Mathematica Notebooks (which you can submit here) than an issue that can be completely addressed here. The people who can best implement the functionality you want in a Mathematica Notebook work for Wolfram. Nonetheless, I think that it's already possible to be pretty efficient using Mathematica's keyboard ...


3

The reason is that in the first table (Table[mu[k], {k, 0, 2}]) the rule substitution (ReplaceAll) does not happen and k in alpha is always take whatever k came from Table. to check that try: alpha := -0.6 + 0.05*1 and then Table[mu[k], {k, 0, 2}] (*{2.22222, 0.689655, 0.408163}*) if you want to go for more details, check in your example this: ...


3

What you see here happens because Mathematica does see this symbol during evaluation. As far as I know, Mathematica has, as many compilers/interpreters, a symbol table where it puts all symbols that it has seen during an evaluation. If you know this, it becomes instantly obvious what the output of Information[ohwhatthehell] is. Or that here 1 /. omfg_ ...


3

The q in Information[q], although different from the q localized in Module is indeed a Global variable. In fact, try any variable you like and you will get the same result, provided that the Context of your notebook is Global. Information[x] (* Global`x *)


6

Replacement rules make this much easier, as Ymareth indicated. Make a list of rules like: r2 = {"x" -> Checkbox[True], "o" -> Checkbox[False], "u" -> Checkbox[3, {1, 2, 3}]}; Then apply these to the matrix m as: m/.r2 Note that this code is idiomatic Mathematica and imminently readable by anyone familiar with it. Nested For loops and ...


2

There is a missing semicolon just behind the end of the outer For, just before the x, corrected below. addChekboxesTable[x0_] := Module[{x = x0}, For[i = 1, i <= Length[x], i++, For[j = 1, j <= Length[x[[i]]], j++, If[x[[i, j]] == "x", x[[i, j]] = Checkbox[True];] If[ x[[i, j]] == "o", x[[i, j]] = Checkbox[False];] If[ x[[i, ...


5

You should use Block to keep external definition from being substituted while the RHS of the definition is being evaluated. rem = 1; Block[{u, rem, reengy, fun}, refun[u_, rem_, reengy_] = DSolveValue[{D[D[fun[u], u], u] + (-rem^2 + 1/4)/u^2*fun[u] - u^2*fun[u] + reengy*fun[u] == 0}, fun[u], u] /. C[1] -> 0 /. C[2] -> 1]; ...


2

First thing to note is that your HighLevelFunction is not relevant here. When it's evaluated, res variable, inside Module, evaluates to result of LowLevelFunction call. res$... symbols you're seeing are coming from Module in your LowLevelFunction. In this module you're saving your calculation results as DownValues of temporary module variable res. If you ...


6

Generate and export Unique variables from LowLevelFunction. LowLevelFunction[ba_] := Module[{res}, res = Unique["res"]; Table[res[elem] = If[ToString[ba] == "yes", X, 2 X], {elem, {one, two}}]; res] These variables are not temporary, and you should be able to save them


2

As I commented earlier, with a notebook configured as in your question, I obtain your first answer with MMA V10 and your second answer with MMA V9. Evidently, Wolfram Inc identified the V9 behavior as a problem and fixed it in V10. Since the problem occurs for ToExpression run in ParallelTable, perhaps ToExpression[ParallelTable["b" <> ToString[j], ...


4

One type of scoping uses "textual" replacement, meaning the symbolic layer of evaluation is bypassed. For example: With[{i = 1}, SymbolName[Unevaluated[i]]] SymbolName[Unevaluated[1]] This property of With makes it very handy sometimes, simply as a way to avoid evaluation where it is not wanted. I learned this myself in this question. Compare that ...



Top 50 recent answers are included