20 votes

Restarting Mathematica automatically

You could launch a different kernel and use that to run the computation. You will be controlling this "slave kernel" from another Mathematica session. This will allow you to script even quitting and ...
Szabolcs's user avatar
  • 234k
9 votes

Restarting Mathematica automatically

On Windows you can run your cycles in a batch file like this: ...
Chris Degnen's user avatar
  • 30.8k
9 votes

Automatic image recognition of Lissajous figures on oscilloscope

This is not a particularly efficient solution, but it works since you have a very limited range of possible parameters, and the screen images are not too distorted. It also determines only ...
Domen's user avatar
  • 21.8k
8 votes
Accepted

How to automatically do a computation, Quit[], restart and do a new computation

You can start a fresh extra kernel programmatically from your current notebook using MathLink. You can then load packages in that kernel, perform necessary calculations, get the result back to your ...
Ray Shadow's user avatar
  • 7,806
8 votes
Accepted

how to plot the dispersion curve in first brillouin zone?

The "folding in" of the reduced zone scheme is achieved by translating the center of the energy function, placing one center on each brillouin zone edge: ...
C. E.'s user avatar
  • 70.4k
7 votes

Web Browsing Automation: how to expand all comments under a blog post?

Here is one way to do it, using WebUnit: Needs["WebUnit`"]; InstallWebUnit[]; StartWebSession[]; OpenWebPage["http://suggestions.livejournal.com/825341.html"]; ...
Arnoud Buzing's user avatar
6 votes
Accepted

Drawing finite-state automata without using VertexRenderingFunction

You can use the default vertex shape (Disk) and use the option VertexLabels (that is, no need to use ...
kglr's user avatar
  • 392k
5 votes

Automatic variable naming

Subscripts are evil. Why don't you use an Association? This would get you rid of the whole numbering business. This could look like this: ...
Henrik Schumacher's user avatar
5 votes
Accepted

Define Macros to automatically change keyboard input

With an input auto replacement like "fss", you need to have some way of telling Mathematica that "fss" is a complete token. That is, "fss" only gets replaced when the next character is not a letter. ...
Carl Woll's user avatar
  • 130k
5 votes

UseFrontEnd is not working the same in version 10.4

UsingFrontEnd achieves the same result, although the notebook execution is no longer visible. runProcess.m ...
Chris Degnen's user avatar
  • 30.8k
5 votes
Accepted

Is it possible to automate definitions given with TagSetDelayed?

You mean something like: ...
Sjoerd Smit's user avatar
  • 22.8k
4 votes

Seeking strategies to deploy a function securely without a front end

Contrary to what most people say (including people working at Wolfram), you do not need Mathematica to run Wolfram Language scripts. What you need is a MathKernel and the wolframscript interface. You ...
Fortsaint's user avatar
  • 2,060
4 votes
Accepted

Is there a way to automate this procedure?

Try writing your code as a series of functions that link back to each other rather than manually carrying results through. For example, instead of copying ...
eyorble's user avatar
  • 9,373
4 votes
Accepted

Creating an Array with Subscripts and Superscripts

You may use, e.g., MapThread[ SubsuperscriptBox["c", ##] &, {Cs, Ss1} ]
Henrik Schumacher's user avatar
4 votes

Creating an Array with Subscripts and Superscripts

Cs = {1, 2, 4, 5}; Ss = {1, -1, 1, -1}; Ss1 = Ss /. {1 -> "+", -1 -> "-"}; Thread[Subsuperscript["c", Cs, Ss1]] You can also <...
kglr's user avatar
  • 392k
4 votes

How to make a for loop to automatically make a series of m differential equations?

Using symbols like "n1" makes it complicated. I would rather use indexed symbols like "n[1]" or subscripted symbols. ...
Daniel Huber's user avatar
  • 49.9k
4 votes

Evading the fewer dependent variables than equations error

DSolve[{f'[x] == 0, g'[x] == 0, f'[y] == g[y]}, {f, g}, x] (* {{f -> Function[{x}, C[1]], g -> Function[{x}, 0]}} *) Or ...
Akku14's user avatar
  • 17.3k
3 votes
Accepted

How can I get Manipulate[] graphics to print when batch printing notebooks?

Consider this. I have 3 notebooks, {"nb1.nb", "nb2.nb", "nb3.nb"} which for the sake of testing all have a simple Manipulate ...
ktm's user avatar
  • 4,232
3 votes
Accepted

How generalizes (automate) recursive code

One way: ...
C. E.'s user avatar
  • 70.4k
3 votes
Accepted

How to get a audio file's duration time in Mathematica?

Now,in Mathematica 11. Using Duration function make it more easily: Import["ExampleData/car.mp3", "Duration"] Or ...
partida's user avatar
  • 6,786
3 votes
Accepted

How to omit the authentification dialog during URLRead?

V11 update For new functions it is enough to use documented Interactive option: ...
Kuba's user avatar
  • 137k
3 votes

Modifying codes in a more 'Mathematica' way

Another way: ...
Michael E2's user avatar
  • 234k
3 votes
Accepted

Modifying codes in a more 'Mathematica' way

You did not provide Mat (btw, don't capitalize your own symbols), but the following illustrates one approach to what you describe (edited): ...
Alan's user avatar
  • 13.7k
3 votes

How can I terminate a MathKernel that is running an external program after a timeout?

Without the program in question, I had to fake it using sleep (which may not even exist on Windows), but here's a rough outline that I believe will work for your ...
Pillsy's user avatar
  • 18.4k
3 votes

How to make a parallel auto-generated .wl package from a .nb notebook

UPDATE 2.0 I just discovered this wonderful answer by Mr. Wizard on saving as a package via FrontEndTokenExecute and so this is an even more trivial task now: ...
b3m2a1's user avatar
  • 46.8k
3 votes

Evading the fewer dependent variables than equations error

Here's a start (a truck fire shutdown the highway and we were stuck in the mountains; so I had some extra time and got the below to work with systems as well). Assumptions about input: The systems ...
Michael E2's user avatar
  • 234k
2 votes

How to automate repetitive evaluation of a notebook from a parent notebook

Per george2079's recommendation and Yves Klett's reference to How to build and operate a master Notebook?, I think this is better closed as a duplicate or not at all, since it is a slight extension of ...
Michael E2's user avatar
  • 234k
2 votes

Automatic process to replace missing values, coming from a second matrix

This looks convoluted, but it matches the requirements you set up ...
Jason B.'s user avatar
  • 67.9k
2 votes

Place Holder or Suppressing Re-ordering

You can do this, "file" <> IntegerString[#] <> ".jpg\n" & /@ Range[0, 9] // StringJoin or this ...
Jason B.'s user avatar
  • 67.9k
2 votes

How to modify a file opened by NotebookOpen

Just as an example, I created two files under the same folder, one named "run.nb" which is the file I'll want to evaluate for multiple times, another is "run1.nb" that controls the running process. ...
Wjx's user avatar
  • 9,558

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