Mathematica 变量管理
Mathematica 变量管理

Mathematica 变量管理

众所周知

Mathematica的变量管理还是挺缺失的,所以使用一些代码来添加变量管理:

CreateWindow[  PaletteNotebook[   DynamicModule[{initPlot, arrays, display},     Column[{Dynamic[       Grid[With[{expr = ToExpression@#}, {PasteButton[RawBoxes[#]],             Head[expr], Dimensions[expr], ByteCount[expr],             Button[Style["Display", 10],              CreateWindow@              PaletteNotebook[               Pane[TableForm@expr, 400 {1, 1/GoldenRatio},                 Scrollbars -> True, AppearanceElements -> None],                WindowTitle -> #, WindowMargins -> Automatic,                WindowSize -> 400 {1, 1/GoldenRatio}]],             Button[Style["Clear", 10], ClearAll@#],             Button[Style["Remove", 10], Remove@#]}] & /@ arrays[],         Alignment -> Left], UpdateInterval -> 1,        TrackedSymbols -> Full],       Button["Prepare plot", initPlot[], Method -> "Queued",        ImageSize -> CurrentValue@"DefaultButtonSize"]}],     Initialization :> (arrays[] :=        Select[Names["Global`*"], Head[ToExpression[#]] === List &];      initPlot[] :=        CreateDialog[        DynamicModule[{names = 1, picked},          Column[{TogglerBar[            Dynamic[picked,              Which[Length[#] <= 2, picked = #, True,                picked = #[[-2 ;;]]] &], arrays[]],            Button["Plot", DialogReturn[];            CreateDocument@             ListPlot@              If[Length[picked] == 1, ToExpression@First@picked,                Transpose[ToExpression /@ picked]];,             Enabled -> Dynamic[Length[picked] > 0],             Method -> "Queued"]}]], Modal -> True])],    WindowTitle -> "Global Lists", WindowSize -> {Fit, Fit},    WindowElements -> {"VerticalScrollBar"}]]

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据