Linked Questions

3
votes
2answers
120 views

Iterating with Do rather than NestList

This code below works fine for me. ...
0
votes
0answers
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. ...
1
vote
1answer
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++)
5
votes
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. ...
0
votes
2answers
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? ...
1
vote
2answers
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 ...
1
vote
1answer
1k views

Converting Matlab code to Mathematica [closed]

I have following Matlab code: ...
0
votes
1answer
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 ...
0
votes
1answer
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 ...
0
votes
1answer
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 ...
2
votes
2answers
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 ...
0
votes
3answers
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. ...
2
votes
1answer
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 ...
6
votes
2answers
165 views

Achieve performance that is competitive with numpy [duplicate]

What are the best practices to ameliorate time performance of Mathematica? As a practical example how we can decrease timing below? ...
1
vote
2answers
3k views

Tag List is Protected Error in simple script

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: ...

15 30 50 per page
1
2 3 4 5
8