# Questions tagged [procedural-programming]

271 questions
Filter by
Sorted by
Tagged with
115 views

### For loop, use past iteration

So I'm trying to use Newton's method to find the root of a function. The code works, what isn't working is my absolute error calculation. What I need is to subtract my past iteration from the current ...
55 views

### Alternative to procedural loop with evaluation of notebooks

very new Mathematica user here. I am struggeling with programming Mathematical-like and would appreciate some guidance. I set up a main notebook which calls various sub-notebooks: ...
440 views

### Create variables in a for loop

I am very new to mathematica, but it would be much easier for me to use For loops in order to create variables. My train of thought was simple, but apparantly does not work. Let's say I defined these ...
67 views

### Code to generate many Do-loops, where the $i$-th loop has upper bound given by $f(i$)

How do I get Mathematica to run an arbitrary number of Do-loops, where the i-th loop it upper bound given by some function $f(i)$? I badly need help with this. Let's denote the desired code by ...
58 views

35 views

### More efficiently access iterator values in subkernels?

I'm looking for more efficient ways of observing values in loops in subkernels. For example, take a standard Do loop: ...
923 views

### Improve speed with a double for loop

I am trying to calculate the Euclidean distance of pairs of points $(x_i,y_i)$ with $x$ and $y$ given as separate lists. ...
292 views

### An efficient way to evaluate this expression with deeply nested Do loops

Is there an efficient way to evaluate something like this? ...
49 views

### How to deal with procedurally generated rules and patterns?

I'm trying to procedurally generate replacement rules of the following form ...
46 views

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

I have a lot of text files in my folder (in this example I'm using only 8). I am trying to import all of them and then do calculation on each individual file; I want to use the same notebook without ...
49 views

### Can I use StringReplace to write the number of row which I am replacing?

I have a text file which I have constructed as ...
56 views

### help with improving my code

I am fairly new to MMA-12 and have written the following code to calculate possible coordinates (for given constraints [see If[]] in the code) and get the ...