7

2) Is there a way to make mathematica autogenerate packages with proper indentation, so I could avoid these problems in the future (should I have access to the mathematica frontend again)? I do not think that Mathematica has any built-in capability to produce decently formatted plain-text code. This is something that bothers me a lot, so I've been looking ...


2

Cases[ exampleInput , HoldPattern[(Set | SetDelayed)[f_Symbol | f_[___], _]] :> Hold[f] , {2, 3} ] // Apply[Join] Hold[selPos, selNeg, selNegPair] Does it fit your needs? {2,3} is there to handle HoldComplete[ _ ] and HoldComplete[ _ ; ], but I am not sure how flexible it should be because the input cell can contain {{{{{ f =1 }}}}} for example. ...


1

Suppose you assign your Output to c, then Cases[Cases[c, e_Cell :> MakeExpression[e, StandardForm]], ExpressionCell[line_, "Code", ___] :> ToString[Unevaluated@line, InputForm], -1] // First returns "F[x_] := x^Sqrt[2] + 1"


1

I am likely missing the point, but why not store the scenarios (NB2) in a simple text file, one record per line. 3 7 2 9 5 4 1 0 1 8 5 4 You can then read the whole file from NB1 as a list, an assign values to variables in a loop. a X1 + b Y1 == A1; c X1 + d Y1 == B1; data = ReadList[FileNameJoin[{$UserDocumentsDirectory, "dataN2.txt"}], Number, ...


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