All Questions

6
votes
2answers
337 views

Pruning elements in an array based on the existence of similar elements in adjacent arrays

Imagine I have a series of particles floating around in $\mathrm{R}^3$, where, at any given time, particles can pop into and out of existence. Here, for some number of time points, $(t_1, \dots, ...
4
votes
3answers
352 views

ContourPlot and Colorfunction

I have the following code: ...
1
vote
0answers
75 views

ReadList with type Expression unable to read scientific notation? [duplicate]

I have a file that defines an array of numbers like this: freq["AQs"] = 8.846947803007962E-4 ... I am reading the file with ...
0
votes
1answer
110 views

Conditioning on group of functions

I have two sets of functions which I want to implement them in a single function with an option indicating which set of functions should be used. Suppose that I have two lists like:(updated example) ...
10
votes
3answers
439 views

How to make Excel-like data bars?

I would like to make a grid where each cell background is partially filled according to the numerical value being represented (on a scale from 0 to 1). Similar functionality to the one requested in ...
6
votes
1answer
1k views

Mutual Information involving two matrix states

I basically retrieved the following technique of evaluating the mutual information involving two matrices from this site at http://bmia.bmt.tue.nl/People/BRomeny/Courses/8C080/default.htm The ...
6
votes
5answers
208 views

Lowering the degree of an polynomial with an assumption that the polynomial has a factor x^2+ax+b

Let's assume $ x^{10}+x^5+1 $ has a factor $x^2+ax+b$ Then, If $x^2=-ax-b$, $ x^{10}+x^5+1 =0$. If we successively apply $x^2=-ax-b$ to $ x^{10}+x^5+1 $, we can make $ x^{10}+x^5+1 $ to degree 1, ...
9
votes
1answer
587 views

FourierTransform and Partial Derivatives?

I have a function of three variables $f(x,y,z)$, and it obeys a linear partial differential equation. I'm checking my by-hand calculations with Mathematica. I want to convert the PDE into the ...
3
votes
1answer
544 views

Simplifying an ArcTan expression

The expression $\tan ^{-1}\left(\frac{\sqrt{L^2 \sin ^2(\theta )}}{\sqrt{L^2 \cos ^2(\theta )}}\right)$ can be simplified to $\theta$. After some attempts I got the following to do the job. ...
1
vote
3answers
515 views

Phase portraits and StreamPlot

I typed StreamPlot[{y, x-x^3-0.3y+0.5Cos[1.25t]}, {x, -2.5, 2.5}, {y, -2.5, 2.5}] but all I got was a blank plot. What did I do wrong and can I fix it?
25
votes
6answers
491 views

Constructing symbol definitions for With

I would like to be able to define two arrays, one containing symbol names and one containing the values of those symbols, for use in constructs such as With. For ...
8
votes
4answers
351 views

Gather list elements by index

The following list has some elements that are labeled. For example {1, 2} -> 1, {-1, 3} -> 3, etc: ...
1
vote
1answer
241 views

How to tell Mathematica not to simplify an expression

While there is this question with a very similar title, it does not answer my question, which is: I have part of an input, in my case Re[Exp[I*x]] which ...
3
votes
2answers
242 views

two histograms ratio

I have two histograms and using listplot to draw both. Now, I want to draw a second plot, below the first, with the ratio of each bin. Does anyone know how to do this? Many thanks. This is the code ...
14
votes
3answers
663 views

How to get rid of the perspective effect in a 3D graphics

I have plotted a figure of MoS2 crytal structure. But the actual output looks like the spheres are not in the correct position due to the perspective effect. I obtained the correct position figure ...
-1
votes
1answer
90 views

How can I format DisplayFormula Cell into TraditionalForm when export as HTML

This example is in DisplayFormula cell. ...
4
votes
1answer
182 views

Modified definition of Sin does not work in Plot

I don't know if this issue has been discussed before, if anyone know any related post, please let me know, thank you :) Unprotect the function ...
5
votes
2answers
190 views

How can I use Pick[] to select items in one list when a value in a corresponding list is $\leq$ some value?

Imagine I have two list: List1 = {0, 1, 0.6, 0.5, 1.2, 0.4}; List2 = {"a","b","c","d","e","f"}; How can I use Pick to return a third list consisting of items in ...
2
votes
0answers
46 views

How can I account for assumed X and Y errors when using findfit? [duplicate]

I'm using very noisy biological data, and I need to assume, when doing linear regression, that there are errors in both X and Y. ...
1
vote
1answer
101 views

Eliminate some temporaries from a set of equations

I have a long set of equations, mostly obtained by introducing physics related quantities which stand for some kind of temporary variables: ...
5
votes
3answers
248 views

Switching among view points in a Manipulate expression

Edit: Some additional viewpoints were included to make it easier to test. Here's code for an alternative function, the graph of which is a bit less symmetric. Feel free to use either code set: ...
0
votes
2answers
122 views

Create a Matrix out of two matrices

I have two matrices A = {{a1,a2},{b1,b2}} and B = {{x1,x2},{y1,y2}}. I would like to create out of these matrices a new matrix ...
1
vote
1answer
155 views

Using Collect to gather explicitly imaginary terms

Collect[Expand[(x + I y)^6], I] yields x^6 + 6 I x^5 y - 15 x^4 y^2 - 20 I x^3 y^3 + 15 x^2 y^4 + 6 I x y^5 - y^6 How can I ...
3
votes
1answer
147 views

MathLink and writing *.tm files

My goal is to use MathLink to access the functions in sofa (Standards of Fundamental Astronomy) So far I have had mixed success. I have very little C programing experience so I am hoping to get ...
0
votes
2answers
88 views

Generating equally distributed voxel points based on a given point

I have a list of seed points that each of them indicates the bottom-left value of a voxel. In order to improve the accuracy of my function, I need to equally sample my points and apply my functions ...
3
votes
0answers
90 views

Finding the argument set for internal functions in Mathematica v9.0

I've recently run into a problem with importing TIF stacks in Mathematica: Slow import of multigigabyte TIF image stacks On the advice of Simon Woods and others, I've been looking into the behavior ...
6
votes
1answer
159 views

Symbolic tensor simplifications and the identity matrix

How can I get Mathematica to simplify the following expressions, with $Assumptions including Element[n,Integers], n > 0, and ...
5
votes
2answers
739 views

Place plot markers in front of error bars with ErrorListPlot

I'm making an ErrorListPlot where the error bars are a different color then the markers and it works, however, the error bars are drawn in front of the markers and ...
1
vote
0answers
166 views

Making simultaneous equation solving more efficient

I am trying to solve a system of several simultaneous equations that have been generated by a series of modules and functions, using this module: ...
0
votes
0answers
30 views

Applying Some Kind of Timing Function to AutoRunSequence [duplicate]

Ok, so I'm exporting a video to MOV format that is coming from a manipulate function (I'm demonstrating CLT to a class that doesn't have calculus as a pre-req, if anyone is curious). Anyhow, I'm ...
0
votes
0answers
45 views

List elements and iterator name collision [duplicate]

Let there be two lists, exp = {{i, i}, {j, j}}; exp2 = {{r, r}, {o, o}}; and there are two Table commands to access them. Then, ...
1
vote
1answer
60 views

Print all cells independently at once

Is there any way to print out to pdf file, in sequence, all cells independently? I have literally hundreds of cells that need to be printed in that way. Selecting each cell and "Print Selections" ...
0
votes
2answers
163 views

Using Button to display dynamic graphics

I have a DynamicModule with several graphic elements. I would like to create a button which would change a parameter and re-run the entire module. Say that we have ...
8
votes
1answer
261 views

How to compile Heike's winding number function?

Heike gave the following function for winding number: ...
1
vote
2answers
164 views

Embedding text on an opaque plane in 3D [duplicate]

A simplified specification of what I am trying to accomplish would be to construct a cube each face with a different color and each face having a text label that can be seen only when viewing from the ...
0
votes
1answer
277 views

Simplify equations using list of rules

I have a set of equations that I want to simplify using a list of rules: ...
2
votes
1answer
217 views

How to obtain a Symplectic 4×4 matrix?

I have a problem in obtaining a $2n \times 2n$ Symplectic matrix $T$, with $n=2$. I couldn't find a direct command in Mathematica to achieve this. Conditions: ...
9
votes
6answers
303 views

Using MapIndexed only at certain elements of a list

MapIndexed is a very handy built-in function. Suppose that I have the following list, called list: ...
7
votes
4answers
380 views

Autocomplete InputField

Is there a way to define a InputField that displays a list of options as you type? More specifically I'm looking for an ...
0
votes
1answer
105 views

How can a package use a variable of a notebook?

I have defined a function g in a package. It is: g[x_]:=x/.t->3 Now I work in notebook with the command: ...
8
votes
5answers
362 views

Span a function across several consecutive elements in a list

Suppose that I have a list called list. I would like to span an arbitrary function f across specified consecutive elements in ...
1
vote
4answers
367 views

Recurrence relation in a table

I am trying to generate a list of x-values for a function using a module, where my x-value must increase by 'a' if the term ...
-1
votes
1answer
267 views

Help in NIntegration Methods - Takes too long, why?

I have this code. It is a triple integral, and using the automatic method gives me a wrong answer for $T=0.1$ (the correct answer is $5.44$, while I got $3.73$ ). I've tried to change the integral ...
16
votes
1answer
814 views

Slow import of multigigabyte TIF image stacks

Update 6: After contacting Wolfram Technical Support, I was advised that the frame-to-frame import timing variability can be eliminated by reading in the frame stack from frame to frame with the ...
5
votes
2answers
176 views

Extract substring by repeated StringPattern

This code failed, but may exemplify my intention. StringCases["aA1bbbbbbbbbbaA2baA3b...aA4b",Repeated[Shortest["a"~~xx__~~"b"],{2,100}]] I want to get the ...
5
votes
2answers
214 views

Is it possible to manipulate FindFit

I was wondering if it is possible to manipulate a FindFit[] function. As a basic example, if I had an equation $ax^2+bx+c$ and a set of data, would it be possible ...
3
votes
1answer
386 views

Explanation about RegionFunction and MeshFunctions?

In the link, ParametricPlot3D, consider the example(Variation on the Spheres) given in the Neat Examples section. Can someone please explain how ...
2
votes
1answer
491 views

Plot a 3D vector field from a file [duplicate]

I have a data file with six columns {x,y,z} and {ux,uy,uz} respectively, and I would like to plot the 3D vector field. http://www.mediafire.com/download/udoa61hu0m6itrc/campo.txt I'm trying to do ...
1
vote
2answers
189 views

How to automatically restart Mathematica kernel after out-of-memory error

I want to run a Mathematica code repeatedly, even after the kernel shuts down when it is out of memory, because I have designed my program to continue appending the data to a file. Currently, I have ...
2
votes
2answers
133 views

How to unthread?

For example {a + b} == {c + d} // Thread (*{a + b == c + d}*) how to get {a + b} == {c + d} from ...

15 30 50 per page