# All Questions

270 views

### Using Read for calling external command does not release file handle

The standard and robust method for piping to/from external commands under Windows is to create a temporary file, save the input into it, pipe it to the command and save its output to a second file. ...
1k views

### Axis/Angle from rotation matrix

With r=RotationMatrix[a,{x,y,z}] I can compute a 3D rotation matrix from axis/angle representation. Given a 3D rotation matrix ...
580 views

### Export complex number to excel or txt file

I'm doing some calculations on complex numbers in Mathematica. I can use Export to generate a file (*.CSV or *.dat, or anything else) of complex numbers. If I want to use excel, origin or Matlab to ...
136 views

### Change all values of a series to positive values

I would like to change all values of a series to positive values. I refer to my previous question, answered in the most part, very elegantly by RunnyKine. However, there remains a slight glitch that ...
143 views

### Confusing font information from CurrentValue

I'm trying to programmatically get the width of a character in Mathematica's default fixed-width font, Courier. I believe CurrentValue holds the answer but I'm ...
80 views

### Command to change binary mlf terms into Subscripted mlf terms?

I express multilinear functions in the following format. Is there any ready command to convert them to multilinear functions easily? Input ...
259 views

### Finding 111 plane of Carbon Diamond

All, I looked at the example on the Mathematica Website with the Carbon Diamond Lattice. Example I am referring to I am wondering is there a way to highlight an individual plane such as the 111 or ...
146 views

### How to modify tick's range in Image3D

Suppose we have an array of color data ...
80 views

### Simple Solve example fails: why? [duplicate]

Solve is an amazing tool, but sometimes it doesn't work in the way I expect it to. The particular instance that is confusing me right now is this: ...
84 views

### How can I mark categories in a BarChart with one instead of multiple labels?

given the following data organized by year ...
453 views

### video image recognition [closed]

Has anybody experience with video and image recognition? I've made a video of two teams playing soccer. Now I would like to translate each soccer-player to a (x,y) coordinate and follow them during ...
152 views

### Simplifying If statements

How can I get Mathematica to simplify the true and false clauses for If[] statements? For example: bar[a_] := a FullSimplify[If[a > b, bar[a], bar[b]]] ...
95 views

### Filling in explicit zeros in a (x,y) list for nonexisting y values for discrete Fourier transform in Mathematica

I have a list of (x,y) values in Mathematica for various discrete x values, as in ...
208 views

### How do I compute the entropy of the beta distribution?

I tried Expectation[-q*Log[q], q \[Distributed] BetaDistribution[a, b]] and got ...
145 views

### Partial factorization of multivariate polynomials in terms of given polynomials

I have calculated several homogeneous polynomials in 4,5 or 6 variables $t_1,\dots,t_6$. I would like to rewrite them as a sum of products of specific lower degree polynomials, which have a meaning in ...
165 views

### Plotting a function only non-zero for discrete values of argument

I have a function like: $$f(E)= \Sigma_{n=0} \Sigma_{\ell=0} \, \delta\left(E+\frac{\ell+2n+2} {R\sec{\rho}}\right) w(n,\rho,\ell)\,,$$ i.e. the function is zero unless  ...
295 views

### Formatting results of a polynomial long division

I am teaching polynomial long division to my high school students. Not a pleasant topic to have to cover. I went to use Wolfram|Alpha and obviously, internally, they have a really elegant way to ...
500 views

### Which methods are available for NMinimize? [closed]

I can't find in the documentation the list of methods available to NMinimize[]. Is there a way to get this? The NMinimize page in Documentation Center mentions only ...
166 views

### List manipulation - various

Update OK, Please forgive the messiness of this, but I am working with something like: ...
401 views

### Why is Poisson Random Deviate Generation so slow?

I am generating Poisson deviates for some numerical work. Mathematica 9.0.1 is very slow in generating these random numbers, as can be seen below. ...
3k views

### How do I make a 3DPlot using cylindrical coordinates?

I'm trying to plot a function of the form $z(r,\theta)$ where $r \in [0, R]$ for a finite R, $\theta \in [0,2\pi[$, and z is the third coordinate, a function of the first two. I couldn't find anything ...
250 views

### Collecting terms of even exponents

Say I've got a polynomial of $4$ or $5$ variables (we'll say $d_1$, $d_2$, $d_3$, and $d_4$). How would you collect the terms where each $d$ is raised to an even power? It collects the terms of the ...
153 views

### Draw the plane on ParametricPlot3D with one parameter

I need to make semitransparent coordinate plane(s) at ParametricPlot3D with one parameter. If I add the second parameter the curves becomes ugly. ...
86 views

### Is there a way to plot discrete functions in mathematica? [closed]

Suppose you have a discrete function Triangle[n/5]. How would you plot it in mathetica?
93 views

### Create huge RandomInteger list

For testing purposes, I'd like to create very large amounts of Random Integers, let's say between $-1000$ and $1000$. I'm using the usual ...
391 views

### Cubic Splines Functions

I have this set of three data points and want the natural cubic spline functions for them: dat = {{-.0247500, .5}, {.3349375, -.25}, {1.101000, 0}}; I tried: ...
797 views

### Ugly output when combining 2 plots with GraphicsRow

Here are the data that I want to plot: ...
229 views

### How to implement a formal expectation operator over an unknown distribution?

I need to do some simplification of an expression involving averages over a stochastic variable (in order to verify a long analytical calculation). The easiest way to do that, I figured, were if I ...
139 views

### Save a sequence of images using table with 2D variables [closed]

How can I save a sequence of images with 2D variables using Table. I get a Iterator {r,{-1,-1},{1,1},{0.1,0.1}} does not have appropriate bounds. >> error ...
47 views

### StatusArea display of message with hyperlink

just trying to label a hyperlink, using an example right from the documentation.... ...
202 views

### Highlight selected curve on the plot

I have several curves on the same parametric 3D plot and I would like to highlight some curves dynamically by choosing them from list. ...
122 views

### Problem evaluating results of DSolve (Power::infy)

So, after browsing through older posts to see if anybody else could have had the same problem, I have come to the conclusion that I am stuck. That bothers me, especially because it should be straight ...
179 views

### Replace doesn't replace the denominator [duplicate]

I have the following expression in Mathematica -((E^(2 - 2 Sqrt[(x[1] - x[2])^2]) (x[1] - x[2]))/Sqrt[(x[1] - x[2])^2]) I want to replace anything of the ...
71 views

### How to format the outputs of several properties of ComponentMeasurements?

I know someone may have asked similar questions but the solution doesn't work to me. My code is like this: ...
95 views

### ListPlot with redundant labels for tick marks

Is it possible to have two sets of labels for the $x$-axis tick marks using ListPlot? For example, could we have tick marks labels: {1,2,3,4,...}, and then right ...
129 views

### Changing equations to be solved by NDSolve when an event is triggered

I am using NDSolve to solve a set of coupled differential equations. When a certain event occurs, I want two equations in the set to be changed radically, for example from ...
1k views

### Speeding up Import and Export in CSV format

I am handling large numerical data in Mathematica. In smaller problems everything worked fine using Export and Import with the ...
367 views

### Summation with constraints

I am trying to do the summation shown below, $\sum_{i_1=0}^{imax_1} \sum_{i_2=0}^{imax_2} \dots \sum_{i_k=0}^{imax_k} f(i_1,\dots,i_k)$ $k$ is a variable. Therefore $i$ and $imax$ are defined as ...
330 views

### Fill circle layers with colors according to read values from a plotted curve

I want to read (temperature) values from plotted (cooling) curves and visualize them in layered circles. I have an example made manually for clarification: 3 plotted curves, at certain time steps ...
207 views

### How to reverse the gradient and ticks in BarLegend

I created a plot with a horizontal BarLegend for TemperatureColors (see1). Code: ...
824 views

### Sum over all permutations

I have n variables and a function that has all of them as variables. n-3 of them in terms of the entries of two lists. The possible entries in the lists $\alpha$ and $\beta$ range from {2,...n-2}. Now ...
192 views

### Implement planar correction for skewed 3D profilometric data

I have some data that represents small-scale surface topography. The data is planar but not flat because it's impractical to level this microscope to a tolerance of microns. It looks like this: I'd ...
163 views

### Does mathematica 9 on mac depend on these dynamic libraries?

The Mac package installing program "brew" suggests I remove some of these dynamic libraries, but I am worried that mathematica 9 might depend on them. As far as mathematica 9 is concerned, is it OK to ...
706 views

### How to find the distance of two lists?

I have two lists as the followings: ab = {1, -1, -1, -1, 1, 1}; ac = {1, -1, -1, 1, 1, 1}; How I can find the difference (more precisely, the edit distance) ...
245 views

### add a scale bar to a microscopy image?

Is there any way to add scale bar to a image for example. I just need to add a bar and a text on top of it to all my images without having to rewrite ...
101 views

MWE ...
299 views

### Is there a way to symbolically invert a piecewise function

I have a piecewise function that is continuous and strictly monotonic, like this: f[t_] = Piecewise[{{t/4, t < 0}, {t/2, t < 3}, {3/2 + (t - 3)*3, True}}] ...
231 views

### Gram Schmidt inner and outer products

I know the Gram-Schmidt orthogonalization generates an orthonormal basis from an arbitrary basis. I need help with: Write a program that inputs a list $\{b_1,\dotsc,b_n\}$ of linearly independent ...