Linked Questions

-4
votes
0answers
50 views
1
vote
1answer
49 views

How to save matrices from each iteration of i? [closed]

I am trying to get the transformation matrices from DH parameter table and would like to save each matrix (Ai) getting after each iteration of i. How can I do that? ...
0
votes
1answer
32 views

Encountering error in For-loop, If statement and Print Function [closed]

I am encountering some error while trying to find roots of equation using Bisection method. In this method, you take an interval (a1,b1), here I have taken (0,1). If f(a1)f(b1)<0, then you take p1 =...
1
vote
2answers
72 views

Error in Assignment

I want to create a matrix with each element updated as per the formula, whose inputs are dependent on the location of element in the matrix. ...
1
vote
1answer
38 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.
1
vote
1answer
42 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 ...
3
votes
2answers
141 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: ...
0
votes
1answer
63 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 ...
4
votes
3answers
344 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 "...
12
votes
1answer
488 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 ...
2
votes
3answers
131 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 ...
3
votes
2answers
188 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-...
5
votes
3answers
967 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. ...
3
votes
2answers
697 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 ...
5
votes
7answers
334 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]...} ...

15 30 50 per page