5
votes
3answers
283 views

How can I set different opacity values for the background of a ListPlot

In the following example: ListPlot[{1, 2, 3}, Background -> Green] how can I set the Opacity[] for the background such ...
5
votes
1answer
171 views

What's wrong with this code to create a matrix?

Here is my code: ...
5
votes
2answers
346 views

Sort matrix by columns and rows without changing them

I would like to sort a matrix in descending order first by the total of each column, then by the total of each row, but without changing their content. For example, if I had: ...
5
votes
1answer
130 views

how to select all cells with specific property such as the ones that are closed

I have to close many cells each time before I export a notebook to HTML since I do not want to display many code cells and other cells. I select each cell one by one, and do ...
5
votes
2answers
151 views

How is OptionsPattern[] defined? Can I replicate this?

I am writing several functions which all take similar input parameters (a complicated nested list structure). Is there some way for me to define a pattern that can be used in multiple places and ...
5
votes
2answers
390 views

Replacements/Substitutions in Mathematica

I am a new user of Mathematica and have some questions about the simplifications of calculated expressions. I am unable to attach an image of the session, but my Mathematica commands are: ...
5
votes
1answer
197 views

Exported graphics texture to eps is too dark

Why is the exported graphics eps file so dark? It looks much lighter (and better) as the Mathematica output appearing the notebook. After running ...
5
votes
3answers
503 views

ColorFunction and/or ColorScaling issue with ParametricPlot3D

My goal is to use ColorFunction to color a cylinder based on the $z$ value of a separate Plot3D. I'm not sure if I am making a ...
5
votes
3answers
194 views

Self-referential list or table of buttons

How could one create a table or list of buttons, such that clicking on a button removes the button itself from the list?
5
votes
2answers
211 views

Reproducing Derive's plot of $1 - x^2 - y^2$ in Mathematica

In Derive 6, if I plot $1 - x^2 - y^2 $, I get this: However in Mathematica 8 I get this: I'm using Plot3D[1 - x^2 - y^2,{x,-5,5},{y,-5,5}] What should I do ...
5
votes
1answer
180 views

Why can't I remove Orderless from Plus?

I am making some random algebra equations, and I want to have the ordering be random too, such that if my random equation generator makes x+1, the output stays ...
5
votes
2answers
246 views

Median marker style in BoxWhiskerChart

I was trying to adapt the BoxWhiskerChart to obtain a minimalistic quartile plot, like this: What I obtained is the plot below that is, however, unsatisfying; ...
5
votes
1answer
316 views

Enabled option for slider in Manipulate not updating dynamically

In a Manipulate expression I have a slider control which has the Enabled option ...
5
votes
2answers
266 views

Why is an integer not considered as a real?

Please consider the following: zeros={0.,0}; data={1, 0., 0}; DeleteCases[data, #]&/@zeros Head/@zeros (*{Real, Integer}*) (*{{1, 0}, {1, 0.}}*) For my ...
5
votes
4answers
308 views

Probability: proportion of 1000 random lists for x that contain the same nrs

Give a function which calculates for each x a random list of birthdays (which can be x=1 to x=365) birthdays[x_] := RandomInteger[{1, 365}, x] is my answer. ...
5
votes
6answers
299 views

Creating sums of elements from a list

I have a list $(d_1, d_2, .. d_k)$ and I want to create all sums that I get for adding only two elements for my list $(d_1+d_2, d_1+d_3,...d_{k-1}+d_k)$. The ...
5
votes
1answer
200 views

Build recursion in parallel?

Problem Let's define a simple recursion. f[1] = 1; f[n_] := f[n] = f[n - 1]*n; If I evaluate f in parallel ...
5
votes
2answers
145 views

How to get the boolean value of an inequality involving an InterpolatingFunction?

Here's the code: yan = FunctionInterpolation[x^2, {x, -1, 1}]; FullSimplify[yan[x] > -1, -1 < x < 1] Needless to say, what I expect to see in the output ...
5
votes
3answers
285 views

How do you properly create Buttons to change dynamic variables using Table

In this example, I want a series of four buttons to change the value of a variable that is used dynamically to drive a plot. I am trying to figure out why using Table around the buttons causes a ...
5
votes
3answers
657 views

Rescale axes (e.g change from Hz to THz)

I have multiple plots of permittivity against frequency, but they're hard to read because the frequency labels go from 4x10^14 to 1x10^15 in Hz. I want to label the frequency with THz instead of Hz, ...
5
votes
1answer
852 views

How do I keep the right ordering of eigenvalues using Eigensystem?

I'm having an issue with the Eigensystem command. I need to diagonalize a bunch of 3 by 3 complex valued matrices, but more importantly, I need to keep the exact ...
5
votes
3answers
262 views

Rendering polygon as graph with directed edges in Mathematica

In Mathematica I'm trying to render a polygon as a set of vertices and directed edges. What I have so far: ...
5
votes
2answers
202 views

Why doesn't Evaluate appear to work in this RegionPlot example with MatchQ?

I am trying to plot the region over which a function of two (real) parameters a and b is real-valued, using ...
5
votes
4answers
468 views

Display position information out of ListPlots inside a Manipulate

I often have the situation where I'll use Manipulate[] to compare and examine 2 or more lists. A simplified example follows: ...
5
votes
2answers
490 views

Coloring edges in GraphPlot

I'm a little stuck with graph drawing part of my research — I can't use the Graph function for plotting my graphs, because my graph is a multi-graph. ...
5
votes
2answers
186 views

Threading behavior of SameQ vs Equals

I ran into a bug in my code today based on an errant assumption. Namely, I thought that: ...
5
votes
2answers
681 views

Wavelet Packet Transform in Mathematica 7 and 8

For finding location of spikes in a time series I used to transform the data into wavelet space using DiscreteWaveletPacketTransform [ data, filter, 0] and then ...
5
votes
2answers
316 views

Equation solving with GroebnerBasis

I have a system of quadratic equations defined below ...
5
votes
4answers
470 views

How to repeatedly show variations on a plot

I would like to show graphics repeatedly with changes in parameters. Neither of the following show anything. Nor do they give an error message. ...
5
votes
3answers
1k views
4
votes
1answer
97 views

How do I randomly select 'k' positions in a list and shuffle their respective elements without effecting the other elements?

Imagine I have some list: listA = {"a","b","c","d","e","f","g","h","i","j"}; I'd like to randomly select k positions in the ...
4
votes
2answers
91 views

Counting the number of instances of one sub-string within a given string within a lower- and upper-bound gap of a second sub-string

Please consider the situation where I give you a list where entries are drawn from a fixed set of characters: ...
4
votes
4answers
244 views

Distance between two line segments in 3-space

I need to compute the distance between two line segments in a project. After googling, I found this algorithm and used it to implement a Mathematica version: ...
4
votes
0answers
46 views

FlipView can't handle CurrentValue[“MouseOver”]. Kernel crash

Is this code crashing your Mathematica session? (it can so look out :P) ...
4
votes
3answers
119 views

Increasing the precision of a calculation

Clearly I have misunderstood how to do this: I seem unable to understand how to get more digits out of a calculation and I can't see why - the following piece of code illustrates the issue. ...
4
votes
4answers
461 views

“do … while” loop equivalent in Mathematica [closed]

Have I missed something or is there no built-in which mimics the behaviour of do ... while loop? I am looking for a construct that evaluates procedure once and ...
4
votes
1answer
102 views

How to inherit options by scoping?

Consider the following example: you have a function framed producing a cell with a button that, when pushed, calls framed again. ...
4
votes
1answer
81 views

Why does a heavy background slow LocatorPane from updating, even if only the locators are Dynamic?

I'm having some trouble getting a dynamic plot to operate efficiently, and I think I've tracked down at least part of the problem to some pretty weird behaviour on the part of ...
4
votes
1answer
342 views

Is it possible to calculate a Lebesgue integral in Mathematica?

As the title says, I wonder if it is possible to calculate a Lebesgue integral in Mathematica, especially when the domain of integration is $\mathbb{R}^N$, or in other words multivatiate Lebesgue ...
4
votes
1answer
75 views

Animated matrix will not work?

I want to export a list of matrices as a gif so that they will appear one after another 2 seconds apart. Ive tried the following but when I open it up it only does the first two matrices, I have 10 ...
4
votes
1answer
73 views

Why Min cannot be used as constrains of NMinimize?

I met a strange problem when trying to do an optimization. Initialization code, ...
4
votes
1answer
76 views

How to control format options of an exported animation?

My woes with Mathematica animations exported in SWF-format continue. The goal is to Export an animation in SWF-format, and also make it scalable, so that when I embed it into a slide set (produced by ...
4
votes
1answer
146 views

Edit Plot/Graphics after it's been drawn.

Sometimes I run into a situation when there are graphics objects (mostly plots) that take a while to draw. Good practice would suggest you do all your evaluation outside ...
4
votes
1answer
125 views

Isn't it possible to Pack a SparseArray?

I have the following matrix Va: ...
4
votes
1answer
160 views

FindFit not giving a good fit despite good initial parameters

I'm having a problem with FindFit not giving a good fit to my data, even though the initial parameters I give look really good when plotted. The fitting function is ...
4
votes
2answers
110 views

How to constrain the generation of all possible orderings?

Here is code from Simon Woods' answer for getting all possible weak (equal ranks allowed) orderings for $N=3$ objects: ...
4
votes
1answer
127 views

Volume within parameter space

Imagine a parameter space with variable 0<p<1, 0<e1<1/2 and 0<e2<1/2. ...
4
votes
1answer
118 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 ...
4
votes
3answers
137 views

Multiple output cells

Is it possible to have multiple outputs from a single function? For example: In[1]:= x+1 x+2 Out[1]= 1+x Out[2]= 2+x has multiple outputs, how can I ...
4
votes
4answers
161 views

How to delete mirror symmetric point pair efficiently

Look at following pic There are five points, I can generate the following point pairs ...

15 30 50 per page