Linked Questions

0
votes
3answers
4k views

How do I show the combined plot from the do-loop?

I have a do-loop to do the calculations from a set of data and plot the graphs with different results, that was obtained from the calculations. I was able to get multiple graphs but I want to ListPlot ...
2
votes
1answer
3k views

converting Matlab program to Mathematica code

I have the following Matlab program; ...
5
votes
4answers
4k views

Finding the area of a circle using monte carlo simulation [duplicate]

I wrote the following code to find the area of the circle $x^2+y^2=1$ using monte carlo simulation : ...
3
votes
3answers
1k views

For-loop not working as I expect

I want to do this: When 10 <= t < 130, give t -> 1; When 130 <= t<300, give <...
2
votes
5answers
2k views

Assigning a particular value to array elements

I have an array of 10000 elements. I want to randomly assign energy to these 10000 elements using Gaussian or Exponential distribution, such that each time a particular element is selected its energy ...
5
votes
3answers
480 views

What is the right way to write a function that includes other functions?

I want to include multiple sub functions: $b(x) = 10x$ $w(x) = s + b(x)$ $c(x) = x^2$ into two main functions: $ua(x) = w(x)-c(x)$ $ub(x) = w(x)-c(x)^2$ As a reaction to this answer, I wrote ...
4
votes
4answers
255 views

How to avoid writing $K$ loops?

I want to evaluate a mathematical function of $K$ variables each of variables varying between 1:N. One way to do this is writing $K$ loops and varying variables accordingly, as shown below: ...
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? ...
7
votes
2answers
479 views

CUDA image processing

I am having an issue with image processing involving CUDALink. ...
3
votes
3answers
2k views

Draw grid lines at multiples of k

Here is a beginner's question: when creating plots with mathematica, I want the grid lines to be at multiples of a constant value. E.g. in the following plot, the vertical grid lines are at multiple ...
4
votes
3answers
393 views

Alternative forms to Table for iterating over replacement rules

I have a multivariate polynomial x. I get coefficients of various monomials using CoefficientRules, which returns a list of ...
0
votes
1answer
7k views

How do I store values in a for loop into an array and then plot that array? [duplicate]

What my title said and I want to plot the values of the array. still new to mathematica and programming so its hard to formulate my question just right
3
votes
1answer
907 views

3 hour calculation? ParallelMap & ParallelTable

I'm having some problems with slow Mathematica code... I'm basically doing a computation that's is expected to take 3 hours (!) in my Core i7 with 4 processors... I'm basically computing an index (of ...
4
votes
3answers
1k views

Stop Computation - Is Exit[] overkill?

The following example either finds a factor of the number $n$ or returns a message saying that the number in question is prime (I specifially wrote this to demonstrate my question below). ...
4
votes
2answers
395 views

Can't use my own discontinuous coefficient within NDSolve

I want to evaluate the pendulum's motion with changing equilibrium state given by eqilValue[t]: ...

15 30 50 per page
1 2
3
4 5
8