Linked Questions

457
votes
37answers
102k views

What are the most common pitfalls awaiting new users?

As you may already know, Mathematica is a wonderful piece of software. However, it has a few characteristics that tend to confuse new (and sometimes not-so-new) users. That can be clearly seen from ...
3
votes
2answers
120 views

Iterating with Do rather than NestList

This code below works fine for me. ...
1
vote
1answer
96 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++)
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. ...
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
1answer
1k views

Converting Matlab code to Mathematica [closed]

I have following Matlab code: ...
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 ...
7
votes
5answers
906 views

What is primary, function computation or function application?

What is the order of computations here? g[x_]:=x^2; f[x_]:=Sqrt[g[x]]; Map[f, Range[100]] Does this code first gets $f(x)=x$ and then gives its values or for ...
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 ...
536
votes
19answers
135k views

Where can I find examples of good Mathematica programming practice?

I consider myself a pretty good Mathematica programmer, but I'm always looking out for ways to either improve my way of doing things in Mathematica, or to see if there's something nifty that I haven't ...
0
votes
1answer
272 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
123 views

Using Append without creating variable

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

15 30 50 per page
1
2 3 4 5
8