Skip to main content
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
  • 236k
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
  • 33.4k
9 votes

Restarting Mathematica automatically

On Windows you can run your cycles in a batch file like this: ...
Chris Degnen's user avatar
  • 31.3k
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,886
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
  • 401k
5 votes

Is the WolframScript error message "The product exited because of a license error" accurate?

I wrote the following file and ran it with WolframScript: #!/usr/bin/env wolframscript Pause[10000000000] and ran it with ...
Ed Bennett's user avatar
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
  • 132k
5 votes
Accepted

Is it possible to automate definitions given with TagSetDelayed?

You mean something like: ...
Sjoerd Smit's user avatar
  • 24.8k
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
  • 401k
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
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,568
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

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
  • 56.4k
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.4k
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
  • 245k
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
  • 138k
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,866
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.6k
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
  • 47.1k
3 votes
Accepted

How generalizes (automate) recursive code

One way: ...
C. E.'s user avatar
  • 71.2k
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,302
2 votes
Accepted

Automatic indentation of text and equations depending on Style

Here's a button that can do this for you. I put it in a docked cell: ...
Carl Woll's user avatar
  • 132k
2 votes

How to use module to assign functions to a set of imported text files?

Next, I would like to loop the whole process so that I don't have to copy and paste my code 8 times for each individual file. Since Import[..., "Data"] worked ...
Nasser's user avatar
  • 150k
1 vote

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

This can be done using Interactions in my EcoEvo package. First, install the package (only needed first time): ...
Chris K's user avatar
  • 20.4k
1 vote
Accepted

How to use 'Join' and '& /@' : combining all .csv files in a directory into a single .csv file automatically

Join is expecting a sequence, as you can see in your MANUALjoin. You can convert your list of lists into a sequence of lists as follows: ...
MelaGo's user avatar
  • 9,111
1 vote

Automate Poisson Football Scores Prediction

I modified code as follows to obtain decimal form: ...
Nate's user avatar
  • 401
1 vote

Running a notebook which imports and exports files repeatedly

Not knowing all of the details, I suggest using an additional Notebook to automate the operation of "my_mathematica_notebook.nb" In the new Notebook ...
OpticsMan's user avatar
  • 586
1 vote

Load multiple csv files and do iterative calculation for each file

What do your CSV files contain? Single columns? Multiple columns? In any case ... Generate some data, then export it: ...
dwa's user avatar
  • 1,959
1 vote

Issue with NotebookPrint to export multiple notebooks to PDF in Mathematica 11.1

Using AbortProtect[] solves the problem.
B flat's user avatar
  • 6,016

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