120 views

### Iterating with Do rather than NestList

This code below works fine for me. ...
54 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. ...
93 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. ...
57 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? ...
58 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 ...
1k views

### Converting Matlab code to Mathematica [closed]

I have following Matlab code: ...
103 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 ...
271 views

### Chi square minimisation wrt variables within an integration?

I'm trying to fit a model curve to some data by performing a chi square minimisation wrt three parameters $a,b$ and $NN$. The trouble I am having is that the variables with which I want to minimise ...
45 views

### An elementary question about For loop [duplicate]

Assume we have this For loop: For[i=1,i<10,i++, i^2]. How can we put the squared values ...
122 views

### Using Append without creating variable

If I use the Append command as follows, Append[foo,1]; I will get an error that says ...
1k views

### In nested For-loops, I want the second For-loop to be evaluated only once in each cyle

I want to print A[0, 0, 1], A[0, 0, 2], A[1, 1, 1], A[1, 1, 2], A[2, 2, 1], A[2, 2, 2] using the following code. ...
152 views

### Procedural implementation of factorial [closed]

I'm a Mathematica beginner. I want to define a factorial function in a procedural way. There are other ways to define factorial function, but I'm asking about the Mathematica grammar equivalent to a ...
I want to have a simple script that gives me all numbers $k \in \mathbb{N}$ in some range such that product of all their divisors is equal to $k^3$. Here is the code that I wrote: ...