# Linked Questions

2answers
39 views

### For loop over several arguments with different length each

I have a set of text files named in indexed way d1, d2, d3, d4, d5, d6, d7, d8, d9. I want to read them by Mathematica and export them back with other index names N(s1f1+s1f1), N(s1f1+s2f2), N(s1f1+...
0answers
30 views

### How to speed up this code (finding eigenvector with smallest eigenvalue)? [closed]

I have following code. The function TraceSystem is to take partial trace of matrix and I think this part is fine. The main code is below in dd and I think the main problem is in here for Eigenvector. ...
2answers
90 views

### Farey Sequence Manipulation

so I am extremely new to Mathematica and currently doing a project that involves calculating a specific function of the Farey Fractions. That is given an interval $I: (0,\alpha)$, I want to calculate ...
2answers
83 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 ...
2answers
85 views

### Chained sums with Nest

I'm looking to calculate a chained sum like this  C_m = \sum\limits_{i_1=1}^N \;\sum\limits_{i_2=i_1+1}^N \;\sum\limits_{i_3=i_2+1}^N \cdots \;\sum\limits_{i_m=i_{m-1}+1}^N A_{i_1}A_{i_2}A_{...
0answers
32 views

...
3answers
282 views

### For Loop to Sum numbers in a list

I'm asked to create a For[] loop that will sum positive numbers in a list. I am unsure of how to do this. ...
2answers
126 views

### Iterating with Do rather than NestList

This code below works fine for me. ...
0answers
57 views

### What techniques have you employed to avoid loop in Mathematica? [duplicate]

It appears to me that loop in mathematica is very slow (compared with matlab). Since many people still use mathematica to finish their work, there must be some techniques to bypass this problem. ...
1answer
433 views

### For loop for two variable at the same time

Can I use for loop for two variables as example show below at the same time? for (int x = 0, y = 0; x < 10 && y < 10; x++, y++)
3answers
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. ...
2answers
61 views

### Loop doesn't hold the value

My program doesn't hold the value in a variable as I want it. I want to attach the calculated value as a list in a variable. What is wrong here? ...
2answers
60 views

### Return is giving me a super-complicated Recursive result in Mathematica 7 [closed]

I'm new to Mathematica, coming from an R and Python background, I need to use Mathematica for my thesis. I have been trying to use Return[] like I'd use return() if I needed to in R. In my practice ...
1answer
2k views

### Converting Matlab code to Mathematica [closed]

I have following Matlab code: ...
1answer
120 views

### For loop from a continous position [closed]

I have a matrix A, which has its elements being function of m, say A[m_]={m, -m*m+2, 5x+m, 3*m+2, -m*m*m, -3+m, m, 5*m*m-4*m, 2*m*m*m} Now, there is a double ...

15 30 50 per page