# All Questions

134 views

### How to remove recursion, and write it functional and efficient way?

I wish to implement the following recursion efficiently. ...
198 views

### Difference between double quotes

I have a notebook and I enter something like PlotLabel->"my label with dynamic number "<>ToString[strange] and I get errors like However, the double ...
273 views

...
71 views

### Computing kernels of a matrix in distinct cases

I have the following matrix: ...
137 views

### Change font of formula number in DisplayFormulaNumbered

I am trying to change the font of the formula number in a cell which has style DisplayFormulaNumbered. I can easily change the font of the formula I enter by selecting it and using the format menu. ...
141 views

### Generating function for Newton series?

The function GeneratingFunction gives generating function for Taylor series. Is there a similar function for Newton's series? $$f(x) = \sum_{k=0}^\infty \binom{x}k \Delta^k [f]\left (0\right)$$
146 views

### Expectation of a composite Markov-Gamma distribution

In a model I have a discrete two-state first order Markov process, defined by a (2x2) transition matrix with two free parameters. If the first state occurs then the process outputs zero for that ...
365 views

### How to add periodicity to condition?

Is it possible to set the following function f[a], where a can be any real number?  f(\alpha) = \begin{cases} 1 ...
95 views

751 views

### Select row from a table by column value [duplicate]

I have the following: animals = {{dog, black, 200}, {cat, white, 100}, {moose, brown, 500}, {zebra,black,100}} If this came from a SQL table called animals, ...
866 views

### Intersection of surface with parallel planes

Consider the code (adapted from here) ...
561 views

### More elegant way

I read ReplaceOrRemoveInvalidOrMissingData Mathematica documentation, and I tried to apply the same approach to my dataset. I've got two problems, but one is only a style problem! There is one more ...
513 views

### ReadList with header and foot lines

I want to do some large data analysis, and i want to be able to import files in a fast way. I tried Import, but it is quite slow; ReadList takes half the time. This is the code I was using: ...
169 views

### Performance on Multinomial Deviate is slow

Most of the time in my program is spent on this single line of code: out = RandomVariate[MultinomialDistribution[nt, tmp]]; ...
213 views

### Simplify equations with pattern assumptions

When simplifying an expression using Simplify[expr, assumptions], the assumptions has to be explicit. Is it possible to simplify an expression with pattern ...
314 views

### How to do Cases with multiple related patterns?

I would like to write a function similar to Cases, but can search for a group of related patterns together. For example, ...
191 views

### Prevent Mathematica from “romanizing” a string of letters?

When I'm authoring in text style (Alt-7), I'll often include inline math. Whenever I enter two or more consecutive letters (e.g., $ax^2$), Mathematica will automatically "romanize" (or "un-italicize") ...
418 views

### Animation is jerky, but slider is not

When I do the following simple animation (from the book Mathematica Navigator, p. 316) the slider control changes the image smoothly, but when I play the animation it is jerky. Is there anything that ...
356 views

### Assigning an analytical approximation to the error function erf(x)

Working with some iterative integral equations, I have Gaussian density functions involved therein. Integrating the Gaussian function I obtain the error function. When I take the second integration, ...
379 views

### Concise way to generate multiset lists

I wrote the following to generate a multiset with the same number of items over a fixed range: ConstantArray[#, 3]& /@ Range[9] // Flatten ...
719 views

### Recursive function for calculating the arithmetic mean of a vector

I want to write recursive function for calculating the arithmetic mean of a vector. For $X(n)=\{1,2,3,\ldots, n\}$, the formula is ${\rm Mean}(X(n))=((n-1)\, {\rm Mean}((X(n-1))+X_n)/n$. My ...
151 views

### Cannot change ImageResolution after applying ImagePad

I want to export high-resolution images of a plot I'm making. The trouble is, the plot has a lot of extra white space around it which I get rid of via ImagePad (I ...
238 views

### Exporting graphics without X server

I have a Mathematica installation on a Linux server that is intended to be used for batch processing. Some of the things that will be processed will include rendering of graphics. However, if I use ...
133 views

### Moving a locator based on the movement of another

My problem is: I want two Locators to simulate a vector in the following sense: The first Locator is the base and the second ...
418 views

### Color of a plane in Contourplot3D

I have the following code example: ...
197 views

### Interpolating a sparse list of two-dimensional coordinates

I've run into a problem where I have an ordered array of sets of coordinates, for example: ...
668 views

### A rotation-like transform on a matrix

Do not be confused with comments, those are for previous version of the question - Kuba Imagine I have a matrix of the form: ...
993 views

### Units, plotting and empty plots

maybe I'm completely newbie but I can't understand the behavior of units and the command plot. I'm doing some easy plotting of the state equation for gasses: ...
155 views

### Issue with scope of variables

For the definitions, t = 1; f[x_, y_] := t (x + y); v[3] := {1, 1}; g[u_] := f[v[u][[1]], v[u][[2]]]; the following two expressions yield different results, ...
486 views

### RecurrenceTable with a recurrence function of two variables

I have to calculate the cool down process of a regenerative heat exchanger. I solved the problem in Excel before, but now I want to do it with Mathematica. I want to create a table with the variables ...
270 views

### Equating two lists, element by element

Say you have two lists: listA = {a, b, c} listB = {d, e, f} How would you produce a listC that equates each of the two's ...
314 views

### How to configure two Mathematica in different places with different settings

For some reasons, I should use two language versions Mathematica. The most reason is I want to see the comparison of Help page(English version and Chinese version) to improve my English, both are ...
190 views

### Picking certain pairs according to a condition [duplicate]

I'm a Mathematica beginner and can't find out a solution to my problem. I have a list of pairs of numbers, for example something like this, but much longer: list={{2., 3.}, {3., 2.}, {5., 4.}, {4., ...
797 views

### How can I consistently get a good logistic regression fit?

I'm executing the command NonlinearModelFit[data, c/(1 + a Exp[-b x]), {a, b, c}, x] with the data being ...
1k views

### Plot FindRoot for non-trivial function

I would like to plot the results of FindRoot over certain range of inputs. I tried to do this with the code: ...
343 views

### How can you combine lines in $\LaTeX$ and lines in Mathematica?

Suppose that you want to make a report about the golden section algorithm, and you want to explain the process with text in $\LaTeX$, and in every iteration you want to show in that report the values ...
1k views

### Join a piecewise plot

I wrote some code to get a piecewise plot which is displayed correctly. Now I'd like to join the various parts of the plot, using some kind of interpolation, to get a continuous chart even though it's ...
752 views

### Save variables values and definition

I used to do a lot of programming in R and recently switched to Mathematica. One thing that bothers me is that I haven't found a way to save variables, their values and definition! Let's look at an ...
823 views

### How do I read a CSV file and remove comments from it

I have very recently started using Mathematica 9.0 Home Edition and am trying to understand it as best I can so please be tolerant ;). I have a file of data (sugar.csv) which contains blood sugar ...
514 views

### Combining and separating sums

How can I combine or separate sums in Mathematica in the way that Together or Expand work for rational expressions？ For ...
815 views

### How can I control the number format of exported data?

I'm having issues while exporting a tables of numerical values to "*.dat" data files. Here's the thing, sometimes when I export a table, I get more decimals on some random values. The problem is that ...
587 views

### How to combine some elements of a list?

In order to simplify my expression, I face a list manipulation problem. For example, given the input list ...
While playing around with $Pre and$Post I created this very annoying piece of code: ...