162 views

### Two actions in the loop body

Help me please, how I can write two action in the body of the cycle "for"? For example, if I need to write Print[] and Append[] at each iteration.
48 views

### How to sort the “do” output?

So I have function (FindCoefficients) that iterates through some values to find the maximum value for a function. It is much quicker to hold the non-linear values constant and do a find maximum for ...
466 views

### Print characters from list with a For-loop

Suppose I have the list primary = {"b","a","e"} I want to get the following output with a For-loop (or While-loop) "b" "a" "e" My code is: ...
333 views

### Parallelizing nested for loops

I'm currently computing nested for loops. I count up a few counting variables and compute a value for each set of counting variables, then that value is added to an array. It is a way of adding up ...
525 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 "...
720 views

### Pascal records and Mathematica programming

Background: "experienced" Pascal-programmer (DOS-era, never got into OOP) proud owner of Mathematica ver 11.2 have used Mathematica for years to do my share of number crunching and plotting to ...
153 views

### Evaluating number of iteration with a certain map with While

Beeing used to programming in C-like languages I am struggling with iterations and loops with mathematica. I am trying not to use the For command, as already lots of people recommended. I am trying ...
201 views

### Correctly defining the return of a procedure

I am sort of new to mathematica and I am struggling with how to correctly set the return of a specific function which is a procedure. I am give the following task: Given the map \$x_{n+1} = r x_n (1-...
1k views

### How to speed up a process

I am wondering how to speed up the following code: Currently it takes more than two sec to be processed. ...
2k views

### For Loop and Sum

I am requested to do a sum of the first fifty positive even numbers by using For loop. The For loop that I created is ...
342 views

### Computing only Prime Powers with NestList

Is there a simple way to compute only prime powers of a function f with NestList? That is, I want to compute: {f[x_0], f^2[x_0]=f[f[x_0]], f^3[x_0], f^5[x_0]...} ...
205 views

### How can I combine the output of a For loop into a list?

I am currently writing on a code to get RandomNumbers which are geometrical distributed. But i need the output in one list because i want to plot the output Can anyone help me? Here is the current ...
805 views

### Solve a system by Cramer's rule using loop

Consider the linear system AX=B,where A={{3, 0, 2}, {-3, 2, 2}, {2, -3, 3}},B={{3}, {-1}, {4}} and x=...