New answers tagged

0

Answer so far, if someone wants to copy, and get points? (Is that legal?) Just a summary of answers, in three days. PDFs are bad. Use 3-stage backup solutions. GIT is good, set Binary attribute in ''.gitattributes'' file. If new version MMA v13 breaks, v12, keep MMA v12 installed? Checkout FreeFileSync mentioned earlier. Distinguish use cases between single-...


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"


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. ...


0

Here is a solution to the above problem. When you add the following code at the end of NB2, each time you run the model with a different parameter set, the results are saved in a file created by OpenAppend[...]. New runs are appended to the previous set of results. (*First create a file to keep the results obtained from each run*) ESTgrowth = FileNameJoin[...


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, ...


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 ...


Top 50 recent answers are included