Questions tagged [scripting]

For questions about Wolfram Language Scripts (formerly known as Mathematica Script), or running the kernel without direct user interaction.

Filter by
Sorted by
Tagged with
2
votes
0answers
67 views

How to use Mathematica code in LaTeX files?

How can you use Mathematica code in LaTeX files? any similar to A random number is RNUMBER and the square of RNUMBER is RNUMBER^2 appearing numbers instead the capital letters (or Mathematica code) ...
5
votes
0answers
62 views

How to properly call Wolframscript from Python?

I am using Windows 10 x64. If I run the following code in Command Prompt: wolframscript -code ToString[TeXForm["Integrate[Tan[x],x]"]] I get the following ...
0
votes
1answer
34 views

Entering natural language input in WolframScript

What is the equivalent of typing = at the beginning of a line to specify natural language input in WolframScript?
6
votes
1answer
78 views

Difference between math and wolframscript

It seems that both math and wolframscript can be used to run Mathematica scripts on the ...
1
vote
0answers
28 views

Running mathematica from terminal

I was looking information about how to run a mathematical script from shell in a remote cluster. Normally, I used this command: math <file.m> file.out& ...
5
votes
0answers
39 views

Logging modules in Mathematica?

Is there any logging module or functions or scripts that one can use to store all the information of what happens during executing mathematica program in Wolfram? For example, one might look up log....
7
votes
1answer
176 views

What is the difference between Wolfram Script and Wolfram Engine?

I don't understand the difference between these products: Wolfram Script Wolfram Engine Would someone help me understand what these are? And how it differs from just using Mathematica in the ...
2
votes
1answer
31 views

Run .m file in terminal

I have the following .m file (* ::Package:: *) (* ::Input:: *) (*out=1+1;*) (*Print["Test"];*) (*Export["/path/test.txt",out];*) and I am trying to run it in the ...
2
votes
0answers
55 views

Characters don't print right in WolframScript

Mathematica version: 12.1 & 11.3 Platform: Windows 10 Since windows's cmd is GBK, so my file is GBK. ...
0
votes
1answer
48 views

Problems in running mathematica file in the background

I have converted my Mathematica notebook into .m file and need to run it in the background on a remote server. I am launching the run from my laptop, on a remote workstation. I need it to obey the ...
1
vote
0answers
29 views

Error while exporting multiple files

I have two questions. I am trying to export results from my calculation when I iterate. I am processing multiple files using code below: ...
0
votes
1answer
40 views

Can't save output in the script mode

I encounter the problem that I can't save any output from Mathematica script. Here is a minimal example. test.m ...
1
vote
1answer
45 views

Missing decades in LogLinearplot

I wanted to display all the decades (from 1 to 10^8 like 1 ,10, 10^2, 10^3 etc) in LogLinearPlot and also tried the solution of why-is-listlogplot-skipping-entire-decades. And my code is something ...
-1
votes
1answer
54 views

Need help to find a value to linearize the data [closed]

I have a two column data which is y vs x. I want to linearize the data by this formula 1/(x-b) but I don't know how to determine the b value such that the ln(y) vs 1/(x-b) becomes a linear line. So I ...
2
votes
0answers
36 views

Difference between versions of WolframScript

On my computer (Windows 10) I currently have installed 4 instances of wolframscript.exe. They represent different versions of WolframScript program and each file is ...
6
votes
1answer
105 views

How to create a progress bar using Wolframscript?

I am using Wolfram script with a Mac OS. I have a long while loop dependent on the length of a list. i.e.: ...
0
votes
0answers
37 views

Notebook ran as batch and CloudDeploy

i am new to mathematica, and i am trying to run a notebook as batch job(i will elaborate on this later). According to the documentation, running mathematica from command line using the -script ...
1
vote
0answers
19 views

Start New Notebook with Wolfram Snippet from Linux Console

Is there a way to evaluate a snippet of Wolfram code from the Linux console (via wolframdesktop, etc) in such a way that the snippet launches a front end (with ...
0
votes
1answer
63 views

solving Impedance divider

How to represent this equation $$ Z1 = \frac{1}{{\frac{1}{R_1} +j \cdot w \cdot C_1}} $$ in this form in mathematica: $$ Z_1 = \frac{R_1}{{1 +j \cdot w \cdot C_1 \cdot R_1}} $$ And then to solve ...
6
votes
2answers
137 views

Destructuring a list containing two items to use it as arguments to a binary function

I'm experimenting with the Through function. I suspect there is a way to use that function to obtain both the mean and difference of two values. But this doesn't ...
2
votes
2answers
103 views

is there something like a “foreach” mode from the command line? Like in perl?

With perl we can run perl -p . That wraps a foreach loop around the code and executes the code on the file. What I'm looking for is something like StringReplace[filename,"\t"->","] and then I get a ...
0
votes
0answers
53 views

Using allocated cores for subkernels on computing cluster

I am really struggling to get to run my Mathematica job on a high-performance-computing cluster (TORQUE based). What I have is: A wolfram script (wls), that is wrapped in a ...
9
votes
1answer
143 views

Importing Packages to .wls without shadow definitions and context specification

I am trying to import a package that works correctly when I use it in a notebook in a wolframscript .wls. I get a weird shadowing problem, however. Here is a minimal working example ...
5
votes
1answer
187 views

How to execute an existing notebook with Wolfram Engine?

[My related question: mwe-for-compiling-functions-into-standalone-dll-and-calling-them-in-python - here I am exploring an alternative] I have downloaded, installed and activated the wolfram engine (...
0
votes
0answers
48 views

Is each instance of a running wls script assigned a separate kernel?

I really like using wls scripts for running my Mathematica calculations on large datasets, as everything can become neatly automated. My question is about the ...
0
votes
0answers
35 views

Export data in a .wls script

I am currently facing the problem that the Export function does not behave as expected if I execute my code as a .wls script. I execute my test.wls file in my ...
0
votes
0answers
75 views

Solve ODE system efficiently with mathematica

I've been trying to solve a system of ODE's with mathematica, which is a master equation of a hierarchically organized tissue model, where I want to quantify the number of cells at level 'k' with 'm' ...
7
votes
1answer
1k views

Installing WolframScript (12) on OSX (Catalina)

I did a clean install of Catalina (OSX 10.15) and Mathematica 12.0 installation was flawless. However I can't install WolframScript which I greatly need. During the installation, after typing my ...
3
votes
1answer
88 views

wolframscript command line output from ParallelDo kernels contains lots of gibberish

I run this code: ParallelDo[ Print["Hi"];, {i,Range[2]} ] And I get this: ...
1
vote
1answer
61 views

Formatting numbers in wolframscript command-line output

I am trying to run the following code using wolframscript on windows: a = 123.4567891011213; Print["a = ",a]; Print["a = ",AccountingForm[a,3]]; The output is: <...
0
votes
0answers
268 views

script to remove multiple Connection Linkedin

Unfortunately i have so many Connections About 20,000 in Linkedin, so i need to delete them all in multiple way, but Linkedin allow one by one. i searched there's a way in Internet, but all of them ...
1
vote
0answers
48 views

Script aborts when I try to build a very large list

I am running the code below ...
0
votes
1answer
35 views

Conditions for solving in NDSolve

I'm trying to solve a system of ODEs but each variable is a probability so I should solve each variable for a range between 0 and 1 and with the sum of all variables equal to 1. This is the system ...
5
votes
1answer
93 views

How do I reliably read from stdin using wolframscript?

I am trying to direct a stream of data to a wls script in a command line environment. Wolframscript provides the ...
0
votes
0answers
110 views

Wolframscript - no output from command when exec'd from php

I am trying to run a simple command via php: echo shell_exec('wolframscript -code 2+2'); However, I am unable to get any output from this command when run like ...
0
votes
1answer
97 views

WolframScript not simplifying output

I'm trying to multiply a matrix and a vector (imported from a csv) in Wolframscript to speed up a process normally done with Mathematica notebooks. This is my first time using Wolframscript, however, ...
0
votes
0answers
57 views

How to turn an algorithm into a function

I have written a script to help me find the several local minima of a dataset. It takes two arguments: the dataset list and an x-coordinate value that tells the script from where to start looking for ...
0
votes
1answer
129 views

Passing arguments into WolframScript in batch mode

I am looking for a way to passing arguments into a WL script when WL run in batch modes. The test script is: ...
0
votes
0answers
48 views

Passing arguments into package from a command line

I am interested in running the same experiment with the different initial state. So, I am looking for a way to passing arguments into a plain text .m file from the ...
1
vote
1answer
62 views

Run a shell script and pass arguments from inside mathematica

Is it possible to run a shell script AND pass it arguments from Mathematica? I have searched thoroughly and been unable to find a way to do this. I want to avoid having to write a .wls for this ...
1
vote
0answers
48 views

Saving a WolframScript File to the cloud?

Is there a way to save the current (or some target) WLS file to the cloud programattically (via wolframscript)? So if we are editing, i.e., ...
1
vote
0answers
24 views

Loading a file immediately upon launching the wolframscript REPL

When running, i.e., a bash shell, usually a file is automatically imported upon launch for convenience (~/.bashrc). Can one do something similar when launching <...
0
votes
0answers
54 views

What techniques have you employed to avoid loop in Mathematica? [duplicate]

It appears to me that loop in mathematica is very slow (compared with matlab). Since many people still use mathematica to finish their work, there must be some techniques to bypass this problem. ...
1
vote
0answers
26 views

How to execute .wls as a web call through Windows IIS

If I have a simple test.wls file (Print["hi"];2+2) that works running in Command Prompt, how do I get it to run through IIS on Windows Server? It just comes up with ...
7
votes
1answer
142 views

What is an example of of idiomatic “typed” WolframScript?

I'd like to make my own "typed function" in WolframScript. Suppose the type we desire is called money, and we'd like to make a function called ...
1
vote
1answer
57 views

Removing Extra Points When Finding an Audio Envelope

I am trying to reproduce Camtasia's way of displaying audio signals which is a strictly positive envelope of the audio signal and very easy for me to identify some sounds visually. These are displays ...
0
votes
0answers
48 views

Testing if a function input is an integer

I am wondering why code like digitback[n_Integer] := Framed[Reverse[IntegerDigits[n]]] can check if the input for the function is an integer (this is the ...
6
votes
1answer
117 views

TeXForm doesn't work in wolframscript?

Consider that $ wolframscript -cloud -code 'TeXForm[ (d u)/(d t)]' TeXForm[u/t] yet I don't have a local wolframscript kernel installed. Is this something ...
0
votes
0answers
87 views

WolframScript Causing Gibberish Characters When Printing to Console

Placing the following in ./file.wls: e1 = a (x + I y) E^(I θ) ComplexExpand[e1] and running ...
0
votes
0answers
20 views

Running CloudDeploy from WolframScript

The following $ wolframscript -cloud -code "CloudDeploy[Manipulate[n, {n, 1, 100}]]" yields ...

1
2 3 4 5