# All Questions

80,791 questions
Filter by
Sorted by
Tagged with
184 views

### Efficient conditional division

I was curious about the following little problem. Suppose $n \in \mathbb{N}$ is some large number and $p$ is a (possibly large) prime, and I want to update $n$ according to n := \begin{cases} n/p, &...
987 views

### RegionPlot3D contour problem

I have a little problem and didn't succeed trying to solve it on my own. Situation is, I need a visualization of the function $s - 3\cdot s\cdot q + q$ as a region on p == 0 if function's value is ...
5k views

### What method does NDSolve use for solving PDEs?

What is NDSolve's mode of operation? I use it to solve partial differential equations and never gave it too much thought. Recently, I came across this question. ...
2k views

### Using a list of tuples in a pure function

I want to use a list of tuples within a function to make assignments. Say I want to make assignments of the form value[i,j] = val What I have is a list of ...
4k views

### How can you compute Itō Integrals with Mathematica?

How can you compute Itō Integrals with Mathematica? I tried searching through the documentations but I didn't find anything. P.S. I was not at all sure how to tag this question. I had to put in at ...
333 views

### Delete a style type from stylesheet

I have created a new stylesheet but now I'd like to delete a style type, for example "program" from it. How can I do it ?
946 views

### Ctrl+= opens the alpha input instead of below-script

When trying to type "traditional style" inputs such as integrals or sums, I follow the tutorial and type Esc sum Esc   Ctrl+= n=1  Ctrl+% 10 whatever However, when I type Ctrl+= it opens ...
408 views

### Wrong computation with N

I was trying to solve this problem using Mathematica 8.04. I did this: ...
3k views

### Funny behaviour when plotting a polynomial of high degree and large coefficients

I am trying to plot a polynomial of degree $29$ on the domain $[0,1]$, with fairly large coefficients: ...
279 views

### Pasting TemplateBox with a Dynamic argument

Ok, this is pretty specific... The objective is to use a TemplateBox to format something that is programatically inserted with ...
15k views

### Mathematica: finding min/max in list

I have a list of coordinates like this one: {{x1,y1},{x2,y2},{x3,y3},...,{xn,yn}} I need to get the minimum and the maximum of all x-values and the minimum and ...
1k views

### Can CDF file embedded in a web page receive external parameters?

I know that I can embed a CDF file inside a web page by using: The embed tag. An object tag with an embed tag inside (better than 1). Using the JavaScript provided by Wolfram (better than 2). My ...
258 views

### Operate on several lists to create one list

How do you put corresponding values from different lists together according to some operation? E.g. I have three lists giving the velocity in the x, y and z direction respectively. I'd like create ...
4k views

### Extracting values from nested rules in JSON data

I have been using Mathematica to analyse some data from the StackExchange API. It is conveniently available in JSON form, which Mathematica interprets as replacement rules. However, some of the rules ...
233 views

### Is there a way to have a Tooltip for non-editable raster graphics produced by MakeBoxes?

I have a function which produces a large object I would like to hide. Formatting is of course an option but I'm hoping for something a little more meaningful using raster graphics and ...
892 views

### Error when using rule as a list index - { i, x[[i]] } /. i -> 5

I can't seem to use a rule to index a vector. x = Range; { i, x[[i]] } /. i -> 5 I get the following error when evaluating the above code, even if the ...
10k views

### Why does MatrixForm affect calculations?

This is a really newbie question, but it has me confused. Why does this code work without // MatrixForm and doesn't work with ...
4k views

### How to do http POST in Mathematica?

The Import command lets you do a HTTP GET from a URL, like this Import @ "http://merkosoncampus.com/wp-content/uploads/2011/05/higgs-boson.jpg" This sends an ...
2k views

### How to use button to evaluate a cell

I would like to create a button that when I click it it evaluates a cell containing a manipulate code. Also, I would like another button that when I click the output of manipulate disappears. How can ...
3k views

### How to prevent the welcome screen from showing up after I close my last notebook? (Ubuntu 11.10, MMA 8.0.4.0)

I would like to prevent the welcome screen from showing up after I close my last notebook. This is not an issue on my Windows machine, so I suspect it is system dependent. I am running Ubuntu 11.10. ...
1k views

### How to test if optional argument has been given?

I understand that the last call (f) returns True because arg does not exist and thus <...
2k views

### Copying an image from the clipboard, modifying it and returning it to the clipboard

I have a Mathematica script to help me copy images from PDFs and then make the (presumably white or nearly white) background transparent. Typically, I am looking at the PDF in Adobe Acrobat and I ...
1k views

### Split a string at specific positions

Given a string of alphanumerical characters, how to split it simply and quickly at the center of continuous letter-substrings? Is there an elegant and fast solutions out there in the "computational ...
7k views

### From a list to a list of rules

Starting from these two lists, var = {a, b, c} values = {{1, 2, 3}, {4, 5, 6}, {7, 8 , 9}} how can I generate a list of rules? ...
68k views

### Elegant operations on matrix rows and columns

Question The Mathematica tutorial has a section 'Basic Matrix Operations', describing operations like transpose, inverse and determinant. These operations all work on entire matrices. I am missing a ...
278 views

This code: ...
522 views

### How to draw a gene regulatory state space diagram in Mathematica

Is it possible to draw in Mathematica a state space diagrams like these two?! I tried a lot but since I am fairly new to Mathematica, I could not reproduce the desired result.
2k views

### How can I make a 2D line plot with a drop shadow under the line?

You often see plots styled like this (ignore the bar chart component): i.e. with a small drop shadow under the line. (I'm assuming Excel is being used to produce these plots). How could you make ...
6k views

### Extruding along a path

I'm trying to render a 3D image of a path by extruding a circular cross-section along the path, to create a "snake-like" path. Here is an image I found to illustrate: I can't seem to figure out if ...
4k views

### Partition a set into subsets of size $k$

Given a set $\{a_1,a_2,\dots,a_{lk}\}$ and a positive integer $l$, how can I find all the partitions which includes subsets of size $l$ in Mathematica? For instance, given ...
18k views

### subscripts in plot axis labels

Superscripts can be included in axis labels by the use of the caret symbol (e.g., Plot[x^2, {x, -1, 1}, AxesLabel -> {x, x^2}]). How does one include subscripts ...
1k views

### Is it possible to insert an animated image into Mathematica notebook?

I find it very convenient to use Mathematica notebooks to organize the codes + results. I was wondering if it is possible to insert an animated image (say an animated gif) in the middle of a notebook....
498 views

### CDF and MediaWiki

Recently there was a handful of CDF embedding-related topics. However I would like to ask whether anyone has succeeded in embedding CDF into MediaWiki page? I've attempted to do so with the Widget ...
212 views

### Organizing similar datasets using DownValues instead of Contexts

In his answer to this question, Leonid helped me find a way to programmatically generate contexts for holding sets of symbols with the same names. Perhaps a simpler way is to use ...
2k views

### shortcut key for traverse command history in a Mathematica session in a terminal?

I wonder what is the shortcut key for traverse command history (i.e. retrieve last, last last, ..., commands) in a Mathematica session in a terminal? If I hit the up/down arrow or pageup/pagedown, it ...
799 views

### ParametricPlot3D creates a blank graphic in this case

I have been trying to evaluate the following code, but nothing happened. I don't see any result. ...
4k views

### Why can't I define vector v as having subscripted elements v_1, v_2, v_3...?

I'm a very beginner in Mathematica 8 programming. While trying to play a little with tensor analysis I encountered a problem. How to define for example vector in such manner: v={$v_1,v_2,v_3$} For ...
3k views

### How to show values of points on surface plotted with ContourPlot3D

The help for ContourPlot3D starts with this example ContourPlot3D[x^3 + y^2 - z^2 == 0, {x, -2, 2}, {y, -2, 2}, {z, -2, 2}] This returns a Plots of the surface \$...
4k views

### Function to compute the probability of exactly one event occurring out of N independent events

Is there a built in function (or a function in one of the standard packages) that allows you to compute the probability of exactly one event occurring out of some known set of probabilities for N ...
812 views

### Palette with editable InputField

I need a Palette with editable InputField. When I try the code ...
728 views

### SubTitle and SubSubTitle do not group by default

For some reason, the SubTitle and SubSubTitle cell formats do not group automatically on my machine any more, and I cannot ...
224 views

### Make the selection become the button you click

Let's assume I want a button that, when you click it, get the cell that contains it selected. This approach won't work, it selects the cell containg the selection previous to the click. ...
1k views

### How can the {x,y,z} points that fall on the outer boundary of a set of values be selected and smoothly surfaced?

For a given set of x,y,z values, that may, or may not form a uniform shape, how can the center of the data cloud be found, and the surface points be located and a solid smooth surface created from ...
3k views

### Backsubstituting solution into FindRoot

I am trying to solve a system of equations which is dependent to an parameter alpha. So I iterate over alpha via a ...
5k views

### Can I make a plot with gradient filling?

Bloomberg has a standard plot style for its line plots in which it uses a gradient filling. Actually the way this seems to be constructed is that a gradient from the ymax to ymin is used as the ...
175 views

### Organizing similar datasets using Contexts or otherwise

I often import several long time series to analyze something about a city. When I have multiple cities, I use contexts. As a simple example, ...
6k views

### How can I make an X-Y scatter plot with histograms next to the X-Y axes?

I just saw a nice plot there: How could I implement that in Mathematica — by which I mean the plot structure, not so much the styling.
894 views

### Is there an option to plot the Z axis reversed (as shown in the figure)?

Normally the Z axis is plotted from bottom-to-top as shown below : I got a plot with the axis (axes to be more precise) reversed as shown below: Is there a way to force the axes to be plotted top-to-...