# Questions tagged [procedural-programming]

227 questions
Filter by
Sorted by
Tagged with
36 views

### How can I apply code that calculates one element of a list to the whole list?

I have a problem with a while loop in Mathematica. I want to run the whole list "mFromAlice" in the while loop but I dont know how to do that. It works with the first row, which is named x ...
25 views

...
50 views

### Loop function for a list of codes

I have a list of codes that start with importing column D of an excel sheet which has a hyperlink. Then, the code moves onto importing the text version of the hyperlink and further proceeds with ...
47 views

### Avoiding Tables, Do and other loop construction

In my work I have a lot of cases, where I should calculate non-listable functions for a quite large number of points. To be more concrete, consider first listable function ...
142 views

### How can I get the While function to evaluate two conditions simultaneously?

This is probably a basic question but I'm having trouble in writing a While conditional that evaluate two conditions at the same time. I have the following code. The idea is to generate two random ...
51 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 ...
47 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: ...
404 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 ...
62 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 ...
48 views

33 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: ...
I am trying to calculate the Euclidean distance of pairs of points $(x_i,y_i)$ with $x$ and $y$ given as separate lists. ...