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
5 votes
1 answer
247 views

Asymptotic[] Doesn't Actually Compute

I ran into this problem while studying the asymptotic behavior of a probability distribution function called tao2. It computes correctly at positive infinity but doesn't actually compute at negative ...
Jade Peng's user avatar
0 votes
1 answer
104 views

Defining elements of matrix as a function of two variables (the position $(i,j)$ ) [closed]

I have the following array, which generated from grayscale image data,: $$ \left( \begin{array}{cccccccc} 162 & 162 & 162 & 161 & 162 & 157 & 163 & 161 \\ 162 & 162 &...
M. H.'s user avatar
  • 39
0 votes
1 answer
107 views

My plotting comes out to be gray not coloured using AbsArgPlot function in Mathematica. What is the reason for not getting a coloured graph??h

My graph comes out to be gray, not coloured using AbsArgPlot function in Mathematica. What is the reason for not getting a coloured graph or what I can deduce from ...
VARUN's user avatar
  • 3
1 vote
1 answer
153 views

How to initiate a matrix with indexed parameters [closed]

I couldn't find it in the documentation, so I'm posting it here. I want to create two by two matrices as follows: $$ `W = \begin{bmatrix}w_{11} & w_{12} \\ w_{21} & w_{22} \end{bmatrix}, V = \...
user79928's user avatar
2 votes
0 answers
72 views

UnityLink called from wolframscript seems to work, but

I've tried to use UnityLink with Mathematica 12.1.1 on OS X 10.15.7. I found that code running ok in Mathematica FrontEnd does not run correctly if used in wolframscript. When exporting the notebook ...
rlj's user avatar
  • 135
0 votes
1 answer
43 views

How can I pass a string variable to script.m which I run with math -script script.m? [closed]

I am not a very experienced programer, so this question might be trivial. I have a program which should run multiple mathematica scripts. There I need to pass some string variable, say "A" ...
jkb1603's user avatar
  • 125
6 votes
7 answers
290 views

How to find the repeated elements in a vector

Is there a way to write a function where the input is a vector and the output is the elements in the vector that are repeated? I was trying to use something along the lines: ...
Trashlife's user avatar
4 votes
1 answer
100 views

is it possible to stop/kill Mathematica Frontend from wolframscript?

I use wolframscript to generate hundreds of images like this visualization of 4fold symmetry of octahedron (to be combined in animation videos) like so: ...
rlj's user avatar
  • 135
1 vote
1 answer
47 views

Logarithmic steps inside a Do

I have trouble, i need to do several computations inside a loop using values in a logaritmic scale, is this possible? Inside of the cicle i create a several data sctructures, and it currently works ...
Isaac Caballero's user avatar
0 votes
0 answers
52 views

Handling large data generated by a script file (using parallelization in Mathematica)

I want to write a script file Script_file.m which I am going to run on a server and collect all the data in a file named ...
Rohan's user avatar
  • 13
2 votes
1 answer
144 views

Make different Mathematica notebooks stop talking to each other [duplicate]

So basically I am working in two completely different notebooks. But, if I define something in one notebook, it will overwrite the same definition in my other document. Somehow these files talk to ...
John Greger's user avatar
5 votes
1 answer
597 views

Stop a script. Just stop it

How can I stop a mathematica script? Abort[] does not stop the script, just jump over a number of lines and proceed with next lines of calculations. Also, killing ...
Chameleon's user avatar
  • 275
2 votes
0 answers
169 views

Running a Mathematica script passing parameters from within another Mathematica file

What is the recommended way to run a Mathematica file file_loaded.m from another Mathematica file main_file.m passing an ...
Kvothe's user avatar
  • 4,419
2 votes
0 answers
133 views

Help with script for running AceGen generated routine in ABAQUS

I am using the below configuration to run a AceGen-generated viscoelastic element in Abaqus. Abaqus version: ABAQUS 6.14-6, OS: Windows 10, Visual studio: 2013, Fortan compiler: Intel Fortran compiler ...
Manu Hegde's user avatar
5 votes
1 answer
138 views

How to determine the file type of a .m file?

Both Mathematica and MATLAB widely uses .m files, but with diametrically different syntaxes and usage. Currently WRI is moving towards the ...
Gravifer's user avatar
  • 862
18 votes
2 answers
569 views

How to create a CLI for Wolfram language scripts?

Former question: How to use wolframscript to develop flexible command-line tools? I am currently changing a notebook into a wolframscript for a "production" environment, where I plan to ...
Gravifer's user avatar
  • 862
1 vote
2 answers
327 views

Import all files in folder, perform operation, re-export with appended file name

I'm trying to write a short program that does the following over and over again. Import all files in a folder Automatically generate names for the imported files based on source file name. Perform a ...
Drotar's user avatar
  • 107
4 votes
1 answer
146 views

why does wolframscript start an instance of Mathematica frontend?

The following wls file surprisingly creates an instance of Mathematica (v12.1) on OS X 10.15.7: ...
rlj's user avatar
  • 135
1 vote
1 answer
255 views

Wolfram script produces no output

I use Mathematica to create a series of PNG images in a for loop. I want to execute the notebook from the command line in macOS. I exported it as a wolframscript -- see below -- but nothing happens ...
220284's user avatar
  • 371
2 votes
1 answer
160 views

Copying Weights using NetTrain in Mathematica

I would like to implement the PPO algorithm - Reinforcement Learning - in Mathematica. And for that, I need to be able to copy network weights from say subnetwork NN1 to subnetwork NN2 as an update ...
Terrell N.'s user avatar
1 vote
1 answer
151 views

Reading specific data from files

I have a huge number of identically formatted .txt files. I would like to read some numbers at a specific position within the text file (row x, column y..) and put them in another file, then repeat ...
sqr777's user avatar
  • 11
1 vote
0 answers
49 views

Problem in redirecting output from wolframscript

I am having a very strange problem in scripting with wolframscript. As a MWE I have a .wls which prints its command line argument. I launch several of these scripts with a bash script, each ...
giulio bullsaver's user avatar
0 votes
2 answers
140 views

Better method for computing streamlines

Can someone suggest a better way to solve for streamlines? P.S. StreamPlot is not providing accurate results. Here, velocity is...
Anubhav Kamal's user avatar
1 vote
0 answers
36 views

Initializing section header doesn't mark sub cells as initialization cell

I have some definitions organised into Chapter>Section>subsections etc in a notebook. I wish to run this code in wolframscript so I tried (following advise from various question on SE) exporting ...
lineage's user avatar
  • 1,144
1 vote
1 answer
71 views

How to change the RandomReals each iteration

I am intending to use NestWhile in finding a solution with random real values as parameter. ...
Thaddeus Wu's user avatar
2 votes
0 answers
86 views

How to read input stream with no newlines?

I have a script named stdout.wl: ...
kenkangxgwe's user avatar
1 vote
0 answers
311 views

WolframKernel not found when running WolframScript

While attempting to run wolframscript in linux, I get the error "WolframKernel not found. Use -configure to set WOLFRAMSCRIPT_KERNELPATH Or export WolframKernel=/yourpath/WolframKernel" I am ...
BOUNCE's user avatar
  • 589
4 votes
3 answers
375 views

Polar Bubble Chart

I would like to create a plot similar to that in the figure 1. I tried using both ListPolarPlot and BubbleChart, but they do not have the right option for creating a polar bubble chart. Any suggestion?...
Luigi Mancini's user avatar
6 votes
1 answer
218 views

Rendering graphics: UsingFrontEnd vs using a front end

I'm trying to understand how Graphics expressions are rendered. I create an invisible notebook, write a cell and evaluate it, then rasterize the notebook. ...
srossd's user avatar
  • 260
0 votes
0 answers
139 views

Question about Clear function

I have a script starting with Clear ["r*", "data*", "file*"]. Does this clear all variables starting with "r" or "data"or "file"? Also, I ...
Mehdi Ebadi's user avatar
1 vote
3 answers
52 views

Variable depth of nesting inside Table [closed]

I need to create a table where there are variable number of iterators. something like Table[s_1 *s_2 *... s_n,{s_1,1,5},{s_2,1,5},....,{s_n,1,5}] where n is a ...
user50123's user avatar
1 vote
0 answers
41 views

How to retrieve the original mathematical expressions from some sort of scripts?

I quit my Mathematica notebook session mid-computation. When I reopen it, the mathematical expression disappeared leaving something like ...
Hans's user avatar
  • 179
2 votes
1 answer
90 views

wolframscript output differs when code is stored in a file

I noticed that the output from wolframscript appears to be different when running interactively and when running with code in a file. I tried searching for this, ...
SirBogman's user avatar
  • 123
1 vote
1 answer
70 views

How to calculate the variation of curvature along the horizontal axis

I have a data set with $(x,y)$ coordinates. I do the following to import the data ...
newstudent's user avatar
0 votes
0 answers
228 views

Is it possible to generate and export plots in a high-performance cluster environment?

I have access to a cluster that uses SLURM. I am not very knowledgeable about using clusters, so figuring out how to submit Mathematica jobs was a challenge but eventually something was worked out. ...
Illari's user avatar
  • 409
2 votes
0 answers
354 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) ...
Mika Ike's user avatar
  • 3,241
7 votes
0 answers
658 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 ...
AltairAC's user avatar
  • 171
3 votes
1 answer
378 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?
DurandA's user avatar
  • 161
14 votes
1 answer
2k views

Difference between math and wolframscript

It seems that both math and wolframscript can be used to run Mathematica scripts on the ...
Daniel's user avatar
  • 499
1 vote
0 answers
215 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& ...
Ask8's user avatar
  • 637
7 votes
0 answers
91 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....
Xuemei's user avatar
  • 1,616
17 votes
1 answer
6k 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 ...
QuantumDot's user avatar
  • 19.7k
4 votes
1 answer
388 views

Run .m file in terminal [closed]

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 ...
hal's user avatar
  • 783
2 votes
0 answers
128 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. ...
AsukaMinato's user avatar
  • 9,808
0 votes
1 answer
295 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 ...
Divyajyoti's user avatar
1 vote
0 answers
37 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: ...
Erfi's user avatar
  • 121
2 votes
1 answer
537 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 ...
quantum_dog's user avatar
1 vote
1 answer
75 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 ...
chetan kulkarni's user avatar
-1 votes
1 answer
65 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 ...
Nini's user avatar
  • 23
2 votes
0 answers
169 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 ...
Pinti's user avatar
  • 6,503

1 2
3
4 5
8