# All Questions

65,965 questions
Filter by
Sorted by
Tagged with
426 views

### Splitting a list in which figures vary from negative to positive

Consider the following list: data={4078, 256, -1266, -388, 1290, 1368, 1446, 1524, 2}; I would like to split any kind of such list always, when figures turn form ...
2k views

### Solving inequalities for positive Integers

Consider the following; ...
1k views

### How To interactively create a Polygon in a Graphic?

Background: suppose I start with the following (working) snippet. Manipulate[Graphics[Line[{{0, 0}, p}], PlotRange -> 2], {{p, {1, 1}}, Locator}] Ideally, I ...
1k views

### Find roots of polynomial in field extension $GF(2^n)$?

How can I find roots of polynomial in extension field $GF(2^n)$?
211 views

### Is it possible to manipulate graphs by hand? [duplicate]

Possible Duplicate: Generating graphs interactively (GUI) If I plot a graph, is it possible for me to manipulate the vertices such that when I move them, their attached edges will follow. One ...
660 views

### Make EventHandler work for clicks and keys in a Dynamic display

I am trying to write a way that will do certain events depending on what screen is showing. What happens so far is that the screen will change in accordance to a click, but when you try to do the ...
458 views

### Short syntax for accessing SystemUtilitiesHashTableAdd and SystemUtilitiesHashTableGet

I have a need for a struct analogue in Mathematica. After reading this post I came to the conclusion that SystemUtilitiesHashTable is one of the best options. But ...
549 views

### How to match a sequence of complex patterns?

I have list with the form {{a1,b1}->{x1,y1},{a2,b2}->{x1,y2},...} where the {ai,bi}'s can be ...
2k views

### Computing the bounding boxes for Text objects

Regardless of AspectRatio, the Text boxes overlap. ...
945 views

### PieChart with radial coloring/color function

I am trying to visually compare multiple functions that depend on a single argument running from $0$ to $1$. They describe a radial property and so I thought it would be nice to use a kind of ...
423 views

### Why doesn't Cases match all instances of XMLElement, given Infinity levelspec?

Why doesn't Cases match all instances of XMLElement, given Infinity levelspec? ...
5k views

### Torn edge paper effect for images

In my answers to Plotting Error Bars on a Log Scale I used a so called "torn edge" effect from on one of the images. @SjoerdC.deVries commented: "BTW I liked the ripped-out look of your InputForm ...
1k views

### Why doesn't FullSimplify drop the Re function from an expression known to be real?

For some reason Mathematica does not properly simplify this expression: ...
2k views

### Picking random items out of a list only once

I'm trying to create a function that randomly returns a value from a list but remembers the values that have been given before. At the end when the list is empty it should return an empty list. ...
1k views

### Is it possible to Print expressions in reverse order?

Let's say I'm debugging a program step by step and want to Print some expressions (using ShowIt, for example). Is there a way to output the result of ...
7k views

### Finding all shortest paths between two vertices

The built-in FindShortestPath and GraphDistance functions find the shortest path between two particular vertices in a graph. I ...
741 views

### When should I, and when should I not, set the HoldAll attribute on a function I define?

I have seen a number of examples on this site (such as in syntax highlighting and checking evaluation status) in which functions definitions are preceded with ...
2k views

### Printing a Dynamic variable inside Dynamic

I'm trying to Print the variable a inside the Dynamic wrapper. Seems like such a simple question, but I haven't been able to get ...
232 views

### Composite graphics with Row, Column, data aggregation and layout control

This chromogram shown here represents data (mouse activity patterns during visits) for ~20 physicians in a study, each of which may have a variable number of visits in the study (physicians are color ...
2k views

### Add lists with unequal lengths together to create a matrix

I'm trying to create a stacked bar chart using raw data coming from a MySQL server. The result coming back from one query is: ...
401 views

### Front-end glitch when interacting with dynamic content

This is now bugging me too much to ignore it anymore. When I interact with a notebook that has dynamic content, for example moving a slider, Mathematica regularly brings other open notebook windows to ...
448 views

### Align Array Plots

I have two ArrayPlots that I would like to align but my "tweaking" failed yet. I would like each "row" to be aligned. ...
332 views

### How to programmatically create a Manipulate in another Manipulate?

Background: the following Manipulate works as expected ...
14k views

### Plotting a simple relationship with Plot[] results in empty graph

I've moved this question over from StackExchange to get better visibility (and deleted the old question). I have a user-defined relationship I'd like to plot: ...
2k views

### Import DCD (CHARMM/NAMD binary trajectory) file

How can one import the coordinates stored in a binary CHARMM/NAMD DCD file? This is the structure of the file: ...
568 views

### Custom setting of HOME and END keys on mac

Is there a way to set the HOME and END keys on a Mac's keyboard to jump the cursor to the line's beginning and end respectively? ...
1k views

### CustomTicks and small ranges

UPDATE While the self-posted answer below (TickLabelStyle->TraditionalForm) works for most things, it also has the following effect: Integers are given periods ...
397 views

### Mapping and Interpolation

Does Mathematica have a mapping function like scipy or any of the multidimensional ones? By this I mean something like mapping $[1,100]$ onto $[7,20]$ for example. Looking at Interpolate I only ...
250 views

### Using one table for multiple arguments

So I want to plot two graphs (on the same plot). One which is the $\frac{\sum_{i=0}^n x_i}{n}$ and the other $\frac{\sum_{i=0}^n x_i}{n-1}$ where x is a set created by ...
2k views

### Finding a “not-shortest” path between two vertices

In designing a routine for making a simple three dimensional (5x5x5) labyrinth, I realized that my solutions (a solution is a labyrinth includes a single path from {1, 1, 1} to {5, 5, 5} in a 5 x5x5 ...
2k views

### Force function to make assumptions about its input variables in Mathematica

I'm trying to force a Mathematica function to make an assumption about its input variables. In my case, I'm trying to define a function to return the pdf of a Gaussian. But let's use a simple toy case:...
2k views

### How to specify the InputField as a String in Manipulate

I'm putting together a Demonstration which utilizes a function which operates on a (manipulated) String, and I'd like the ...
2k views

### GridLines in LogPlot or LogLogPlot

Suppose I have a plot like LogLogPlot[2 x^5/3, {x,0.1,10}, GridLines->Automatic] How can I achieve to get "custom" gridlines to reduce the number of ...
2k views

### How to Map a subset of list elements to a function?

How would you, given a list {1, 2, 3, 4}, apply a function f to 1 and ...
3k views

### Aligning plot axes in a graphics object

I need to align the y-axes in the plots below. I think I'm going to have to do some rasterizing and searching for vertical lines, then vary x and ...
810 views

### Solving an ODE numerically

I really appreciate it if anyone helps me with this: How can I solve this ODE and plot the answer for $x$ on $[0.6,5]$:  \begin{align*} -2xy'[x] = y''[x]+ 47.21 (-.0025 x^6 & + ...
523 views

### What is an efficient way of selecting multiple colors via Manipulate?

Background: The following snippet is what I (intend to) use in a Manipulate form where up to 12 different colors can be selected: ...
2k views

### Integration with vector coefficients

I asked this same question in Mathematics, and it was suggested I might try here. I'm more comfortable with Maple, but if I can get Mathematica to do what I'm after, so much the better. Basically I'...
20k views

### Plot legend inside a Show [duplicate]

Possible Duplicate: Using PlotLegends with Show messes up the graphics I have created a composite plot function: I want to add a legend to it, however ...
4k views

### Unsaved notebook is crashing: is there any way I can save the state of the MathKernel before I kill it?

So I'm in the middle of generating some plots and all of the sudden the frontend goes dead and I haven't saved my work. I'm using Mathematica 8 in MacOS X. The MathKernel process is still running and ...
766 views

### Part extraction vs functions like First, Last?

There are many ways to extract different parts of lists in Mathematica. For example, the first part of a list v can be accessed either as ...
26k views

### Creating legends for plots with multiple lines?

So I have a graph with multiple lists, for e.g. data = {{1,2}, {3,4}, {3,5}, {2,3} . . .} If I then do ...
6k views

### Map and Apply a function on a nested list

I have a list like this: {{1,2}, {4,2}, {6,4} ... } I want to replace every second number with a function of that number. For e.g. ...
7k views

### Computing and plotting a spectrogram in Mathematica

How can I compute and plot the spectrogram of a signal/time series/data in Mathematica? I have a WAV file, sampled at 44100 samples/second and I want to generate a spectrogram of that data. Something ...
638 views

### Combining heads of lists so that you can create a nested list from two sublists

I have a list such as list = {1,4,3,4,6,3,1,2,3,4 ... } and a range, say, range = Range[20000]. I want to obtain the following ...
1k views

### How to thread a list

I have data in format data = {{a1, a2}, {b1, b2}, {c1, c2}, {d1, d2}} Tableform: I want to thread it to : ...
6k views

### Minimizing a function of many coordinates

I'm trying to obtain a series of points on the unit sphere with a somewhat homogeneous distribution, by minimizing a function depending on distances (I took $\exp(-d)$). My points are represented by ...
2k views

### FindFit returns Infinity::indet error when data contains {0,0}

Let's consider the following data: data = Table[{q, 2*q^2}, {q, 0, 2}]; and then, do a very simple fitting to this data: ...