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+...
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. ...
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 ...
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 ...
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_{...
32 views

...
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. ...
126 views

### Iterating with Do rather than NestList

This code below works fine for me. ...
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. ...
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++)
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. ...
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? ...
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 ...