# All Questions

148 views

### Which function definition is used to evaluate an expression that matches the lefthand side of more than one definition?

In a case like this: f[a_] := a; f[{a_, b_}] := a; I'm wondering whether I should expect f[{2, 3}] to return ...
1k views

### How to extract expression from ConditionalExpression

p1 := y /. {First[Solve[x^2 + y^2 + x == 1, y, Reals]]} ...
232 views

### How do I indent C code generated by SymbolicC?

I'm continuing to experiment with the SymbolicC package, and it's crucial to be able to inspect the generated code in order to do, well, anything useful with it. ...
1k views

### Viewing Mathematica Demonstrations Project Code

I hope I am going insane and the I'm not seeing the snake about to bite me... How does one view the code in the demonstration projects that one can download from wolfram.com? It seems like all of ...
267 views

...
255 views

### Applying a transformation rule on an Image

I haven't been able to figure out why the following doesn't work: ...
956 views

### Find the parameter values satisfying conditions for all roots of an equation

Hi I'm very new at Mathematica. My real problems concerns a much more difficult equation with many parameters, but I want to check that the method is good, so I made up a test equation. My test ...
776 views

### Why is Mathematica's expansion of expressions with square roots so slow?

Mathematica expansion of expressions with symbols isn't slow, but with square roots it is very slow. In Maple or Mupad both are fast: with square roots they both take less than a second. Here is an ...
238 views

### How to automate x[i]→x_{i}?

I have several Mathematica expressions in which subscripts are expressed with square brackets. E.g. x[12] is meant to represent x12, etc. If I evaluate ...
770 views

### Mathematica: Retrieving PlotRange from Histogram

I know that one can retrieve PlotRange of a plot by using AbsoluteOptions[plot,PlotRange] but that won't work on Histogram. Here an example: ...
1k views

### How to position legends exactly where I want them?

I just noticed another plot legend question today and while user solutions to this, in particular code by @Jens, are IMO better than the built in solutions, exact positioning often still requires some ...
389 views

### Making cells group

After reading rcollyer's post I'm still not able to understand how grouping rules work. Here is a problem I'm facing. What I want is to create a new title, section and subsection styles. I want the ...
716 views

### Exporting plots with Cyrillic text elements to pdf

I'm trying to export a plot with some added notes which happen to be in Russian. Using Mathematica 8.04 and WinXP I evaluate ...
771 views

### Hankel Transform integrals won't work in Mathematica

I'm trying to do this integral, which is shown on the Wikipedia page on the Hankel transformation: $$\int_0^{2\pi}\mathrm d\varphi\;e^{\mathrm im\varphi}e^{\mathrm ikr\cos(\varphi)}$$ The answer is ...
254 views

### How to generate Intervals from a given list?

If I have a list list={3,7,4,5,1} how to get the List of Intervals /Ranges result = {{1,3},{3,4},{4,5},{5,7}}
202 views

### Merging lists of pairs [duplicate]

I want to add several fluorescence spectra. They are lists of the format ...
95 views

### How to plot functions with large slope on a compact domain?

The Mathematica command Plot[(1 - r^2)^(1/32), {r, -1, 1}] does not plot the function near the boundary points. That is, the graph does not attain 0 at r = +-1. ...
106 views

### TransformedRegion, RegionPlot broken in 10.0.2.0?

After having had trouble applying TranslationTransform to a simple region like so ...
203 views

### Given the OneIdentity attribute why is GCD[a] evaluated to GCD[a]?

GCD has attribute OneIdentity so I expected GCD[a] being evaluated to a?
337 views

### How to code around known MMa special-case failures?

Fourier Analysis and Signal Processing often require these integrals on functions f[x] that won't be known in advance. ...
132 views

### Unexpected behavior using FromDigits to reconstruct polynomial

I have an issue with the reconstruction of a polynomial using FromDigits. The documentation of the function CoefficientList says: Fold the operation for multivariate polynomials: ...
224 views

### Understanding Dirichlet regularization in Sum

I've tried to calculate few classic sums using Dirichlet regularization: ...
87 views

I have defined several custom analytic functions. Here is the simplest example: ln[x_, a_?NumericQ] := Piecewise[{{Log[x], Re[a] > 0}, {-Log[1/x], True}}] ...
210 views

### Behaviour of out (%%…%) with comments

Can please someone explain to me the diffrent behavior of this code (6 - 3); (5 - 3); (4 - 3); {%%%, %%, %} Out= {3, 2, 1} and this one ...
216 views

### User-defined template; removing repeated text (v 9.0.1)

In Mathematica 9.0.1, I want to write a user-defined template for a function that I wrote: myfunc ...
538 views

### NIntegrate receiving a function with NumericQ which returns a list

Can some one please explain why ...
1k views

### How can I get better control over StreamPlot?

I'm having some difficulties with the command StreamPlot in Mathematica 7.0. Here's the basic plots I'm doing : ...
283 views

### How can text-specific antialiasing be disabled in Rasterize?

While tinkering with the code in the Falling Matrix question, I was hoping to improve the rendering speed by making the rasterizations of the text grayscale. I changed the base color of the text to ...
1k views

### Normal lines to surfaces or planes in a 3D plot

How do I make the normal line to a plane actually look perpendicular? ...
249 views

### Button's command is not evaluated in iteration

I wish I didn't feel like a newbie after several months, but... If I enter the following: Table[ Button[ "Number: " <> ToString @ i, Print @ i], {i, 1, 5}] ...
482 views

### Filter list based on date

What I would like to do is remove entries from a list of instrument data when it is in maintenance. The maintenance data I have is a series of dates which look like this; ...
194 views

### Why aren't the locators independently enabled/disabled?

I am wondering why the Enabled setting for the first locator (point1) overrides the Enabled setting for the second locator ...
343 views

### Color ramp banding in PDFKit when exporting Raster image Inset to PDF

Here I produce a Raster image with large uniformly colored rectangles and put it in an Inset: ...
401 views

### Combining and aligning “chart” type graphics with regular plots

Is there an easy (recommended) way to align regular plots (e.g. ListPlot or Plot) with chart type graphics (...
1k views

### Trying to prove that $x\sin(\frac{\pi}{x})\ge\pi \cos(\frac{\pi}{x})$ for $x\ge 1$

Consider the function f[x_] := x Sin[Pi/x] I want to prove that this function is increasing for $x\ge 1$. This can be done with the first derivative. We have to ...
596 views

### Conditional numerical integration boundaries

I have a multidimensional integration of the form: ...
478 views

### ListPlot InterpolationOrder->0 datapoint centered

it is possible to get a histogram style in ListPlot using InterpolationOrder->0 ...
100 views

### Possible memory leak when importing JSON

Bug introduced in 10.0 and persisting though 10.2.0 This problem that I would like to resolve is how to free memory used Import a file when the file is no longer in use. I have a project in which ...
174 views

### Is there a built-in function to do binary search?

Is there a built-in function to do binary search? Say, given a list (sorted) and a number, find the position which keeps the listed sorted when the number is inserted. I know that ...
104 views

### Sum considers RandomInteger[] as a constant

Perhaps this is expected behavior, but I was kind of surprised by the following: ...
215 views

### Drawing a graph with vertex avoiding edges? (Handling vertices that must be colinear?)

I'd like to draw something like the following graph: ...
112 views

### Fine tuning compiled code that computes dilogarithm function

As an exercise of writing a good Compile function, I want to do the simple task of coding a routine that outputs the real part of the dilogarithm function ...
431 views

### Merging lists and adding common elements [duplicate]

I have two 2D arrays where some of the x-values are identical, L={{1,1},{2,2},{3,3}}; J={{0,1},{2,2},{4,4}}; I want to add these lists in the following way ...
263 views

### Matrix exponential via Cayley-Hamilton Theorem

I'm attempting to calculate the exponential of a matrix via Cayley-Hamilton theorem. (Following the "concrete example" from http://en.wikipedia.org/wiki/Cayley%E2%80%93Hamilton_theorem) I am having ...
952 views

### Understanding Bilinear ImageResize

In trying to understand basic image transformations, I have attempted to code my own image resize function that uses bilinear interpolation. I checked my work against Mma's ...
206 views

### How can multiple null terminated strings be handled in a DLL-function result?

I am trying to connect a classic System Dynamics tool (Vensim DSS) with Mathematica using a DLL that is included in Vensim DSS. Reading though the instructions on how to define DLL functions on how to ...
267 views

### Generate regularly spaced points from the surface of simplexes

I need to generate regularly spaced samples (points) from the surface of unit simplexes with 2 or greater vertices or end points. I can generate random samples pretty straightforwardly: ...
2k views

### How to sum over a List

list = {11.5575, 11.397, 5.52734, 4.0878, 2.54815, 1.86652, 2.55028, 2.14952, 1.6242, 1.34117} I have a list of numbers. How do I make a function that creates a ...