# Questions tagged [iterators]

Questions on using and specifying iterators used in Mathematica functions.

137 questions
Filter by
Sorted by
Tagged with
55 views

### How do I evaluate my functions over a range of values? [closed]

I want to use the list of data which will come from MapData1 (in code); the first element is θ and second is Action(I). I want to use this Action(I) and Angle(θ) in ...
160 views

### How can I use a loop with an iterator in order to evaluate a function?

I'm trying to evaluate a function, that depends on two variables, in a specific set of values. I will write an example, but my system is more complicated. ...
84 views

### Iterative comparison between different vectors

I have some soccer outcomes for each league round to import in a data form similar to that: ...
56 views

### Stop (Parallel)Table evaluation when wanted case is found

I have to go through a long list of evaluations, for which I suppose Table instead of For or ...
47 views

### Making a recursive function

Suppose I have the following functions: a[x_] := x b[x_] := x (a[x]) - a[x] + 1 c[x_] := x (b[x]) - b[x] + 1 d[x_] := x (c[x]) - c[x] + 1 as you can see each ...
98 views

### Does lower case n have some significance in the Wolfram Language? [duplicate]

I am truly confused with this one, and maybe someone could help me to clear this up. I am running a Table[] that runs multiple neural networks in series on OpenAI'...
47 views

### Is it possible to generate iterators dynamically during parallel processing?

I have a parallel processing code written in Wolfram Mathematica, similar to: ...
120 views

### Iterating with Do rather than NestList

This code below works fine for me. ...
61 views

### Problem with iterations of Prepend/While

I am doing some work with black-scholes and am trying to find random interest rates based on some given information. This is my original code: ...
60 views

### How to iterate through a lists of lists and delete a certain element?

Say I have a list of lists such as l1 = {{a, 2}, {a, 5}, {b, 3}, {b, 9}} How would I iterate through the list and delete all the lists with the first element b ...
123 views

### How to nest multiple functions with multiple variables

I'm trying to solve coupled equations by using iteration. There are two functions $G$ and $H$ that I need to find. In the code, G and H are actually lists of numbers. I start by using a simpler ...
43 views

### Nested Table With Iterable Bounds

I have a set of data that looks vaguely like this: ...
31 views

### Iterate through union of lists to correspond to each element a list of names of the lists to which the element belongs

Say I have several lists L1, L2,L3 an I want to correspond to each of the elements of Union[L1,L2,L3] a list of list names to ...
75 views

### How to iteratively (or most efficiently) create such list?

Update A very crude attemp ...
127 views

### Automating a large operation by making a function

I would like to automate the following operation. To be transparent I shall put my code into separate chunks and explain the process. Suppose I have the following: ...
84 views

### For- loop which can reuse updated values [closed]

Eout = E^x ; For[kz = 1, kz < 4, kz++, Print[Eout1[kz] = Eout]; Print[kz]] The output is E^x 1 E^x 2 E^x 3 But what ...
402 views

### Dot products and For-loops

I'm taking a class where we're working with matrix applications inside of Mathematica. In this case, we're analyzing senatorial votes that have been numericized so that a value of 1 corresponds to "...
79 views

### How can I iterate across a list of triples?

i just started to use Mathematica and I`m completely new to programming. So i'm some kind of noob in the purest form.. I'm trying to transform a coordinate system into a different one. I'm using <...
93 views

### Creating matrices using a Do-loop

Here is an image of current assignment; I am not able to do step 6 to 8 When I try to do the Do-loop, it states that the {i, j} does not have appropriate bounds. ...
50 views

### ListCountourPlot does not show any result [closed]

I was trying to show the heat conduction of Laplace equation problem.But the plot does not show properly ...
76 views

### Defining iterative algorithms [closed]

Assume the iterative algorithm of interest to be as follows: ...
376 views

### Multivariate Newton-Raphson method and FindRoot module [closed]

Let's suppose that we have the following equation ...
314 views

### Golden section search method that terminate after $n$ iterations

I am attempting to code a program that executes the golden section search method, and I would like to terminate the computations after $n$ iterations, where the user decides what $n$ is. My code works ...
465 views

### How to programmatically specify multiple iterators?

How to use Row[Table[{B[i],0,i},{i,0,2}],","] directly in Do command? I mean that the following command ...
735 views

### Encountering 'Error: Set::setraw: Cannot assign to raw object' during procedural function definition

Sorry for the rather vague title, but I don't know what is wrong with my code. Here is a Ruby version of what I'm trying to do: ...
111 views

### How to change the dimension of a tensor inside a loop using XAct/XTensor?

I'd like to define a function CDOrder[k] to compute the k-th order covariant derivative of a vector ...
121 views

### Operation on sublists with multiple arguments

I have a list and add only the values which are > 0 with: Total[Cases[mylist, x_ /; x > 0]] How to do this if I now have a list of sublists? ...
132 views

### use Range to form a vector

I have a function y[k_]:={0,0,0,I*t^k}; and I need to get a vector Join[y,y,y,y,y,y,y] and it is just ...
514 views

### Applying loop functions with input list of iterators

Given an iterator, I am trying to generate a table of all possible pairs of values. The form of the iterator I'd like fixed, because I want to run other loops with it as well. The closest to what I ...
84 views

### Iterating a Module

I have a Module that can act on other Modules, which is given as Kk[EE,p,z1,z2,z3,K_func] and I am trying to iterate it, such that ...
105 views

### What is wrong with the Mann iteration?

I have written the Mann iteration's code for the mapping $\frac{z}{1+z^2}$, in Mathematica, but it is very slow. In fact it needs more than 200 seconds for obtaining 17th iteration, while Matlab does ...
242 views

### integral equation iteration

So I am trying to recreate the numerical treatment in this papir (https://journals.aps.org/prb/abstract/10.1103/PhysRevB.29.130), equation 3.7. The main point is to try to solve the following equation ...
58 views

### How to implement recurrence operations efficiently?

This question is related to this one. I basically want to partition a volume recursively. Consider a volume as vol = ExampleData[{"TestImage3D", "MRbrain"}]; ...
52 views

### Using Iterators within the WebSearch Command

I am currently trying to use the WebSearch command within Mathematica to search names from a Dataset that I have already imported. The names that I am trying to search are located in the 4th column of ...
120 views

### Iterator order breaks Table

Evaluating the following Table expression ...
99 views

### Variables defined modulo $\pi$ and avoiding singularities; phase plotting for a map

I have the following $2$-dimensional implicitly defined map ...
144 views

### How to plot a phase portrait of a map for many initial points?

Suppose I have a 2-dimensional map $x_{n+1} = f(x_{n},y_{n}), \quad y_{n+1} = g(x_{n},y_{n})$, and a number of initial points $(x_{0}, y_{0})$ in some given range. I take each initial point and ...
242 views

### Add function arguments in iteration

I have a list which has the number of n. list={x1,x2,x3,x4,x5,...xn} when I use these elements as arguments of a function f[x], I want to express function with ...
366 views

### Comparing elements in a list of lists

I'm stuck with yet another list question. The basic gist: I have lists within a list like so: ...
77 views

### How to run this statement multiple times and put them in a matrix?

I have the following Mathematica Code. ...
186 views

### Replacing For loop with multiple iterator with Table

I have written code for calculating cristofell symbol using for loop with 3 iterators for each coordinate ...
60 views

### How to make a continuous graph in 3D under an iterative process?

I'm solving a problem in which I have to plot a series of image points $P'$ from a set of points $P$ that lies 5 cm away from a sphere with radius 2 cm, in such a way that all $P'$ lies inside the ...
170 views

### Plotting orbit of a discontinuous map

I'm trying to plot the orbit of a two dymensional discontinuous map. Could you help me please? I tried using Piecewise, but I didn't get the result I wanted. The ...
49 views

### Creating a list using previous elements

I am new to stack exchange though I have used it to help me through some struggles before. This question I cannot find an answer to. I'm looking to create a set of polynomials where the 'i'th ...
166 views

### Access list position from iterator?

Consider a list, e.g.: list = {a,b,c,d}; One can compose a Table by directly iterating through the list: ...
473 views

### multiple reflections of a laser beam in a triangle

I want to make a animation that multiple reflections of a laser beam in a triangle looked like, I have tried following, but it's not a good way, I'm looking for a better way(Nested solution). ...
57 views

...
119 views

### Slow evaluation of large matrix

I have been trying to evaluate the matrix ce[n] in the code below but it is taking too long and still running as you increase n (...