4
votes
2answers
207 views
Simpler way to repeat an execution with 2D points?
q has the coordinates of quadrilateral. I can get the output below with brute-force but I want to find a simpler solution, perhaps something like f<-q[[1;;2]].
...
9
votes
3answers
272 views
Compiled function error - nontensor object created
I'm trying to optimize code that uses Position MANY times.
The following toy code works:
...
1
vote
1answer
162 views
How can I permute a multiset?
I have a multiset {1, 3, 3, 1, 2} and would like to randomly permute the classes like so: {2, 1, 1, 2, 3} or {3, 2, 2, 3, 1}, what is the simplest and most efficient way to do this?
In reality the ...
5
votes
0answers
88 views
Page Break Adjustment In Long Documents
Has anyone else had trouble in relocating page breaks in a long document? In a ~45 page long document I wanted to keep certain things on the same page. The system worked on the first three or four ...
2
votes
2answers
119 views
Evaluation of Notebook chosen by FileNameSetter
Please consider the following:
I have created a GUI where I can choose the path of a notebook (which I need for later calculation) via
...
3
votes
0answers
122 views
LeastSquare Solution for the Continuous Time Lyapunov Equation
I have been working with a problem which involves solving the continuous time Lyapunov equation
$$A R + R A^\top = G$$
for the symmetric positive definite matrix $R$. Here $A$ is real, invertible ...
-1
votes
1answer
158 views
Why is the CTRL + / not working?
I've learned how to use this shortcut to input fractions in the 2D form, it worked nice on my notebook but I can't make it on my desktop. Any tip on what could be happening?
3
votes
1answer
143 views
Mathematica's external controllers?
While reading the Manipulate reference I've noticed this line:
What are the available external devices for that?
Some months ago I was thinking on what would be needed to use a MIDI Controller ...
3
votes
2answers
426 views
5
votes
1answer
87 views
How to insert or use the PackageTemplate?
In the system resource file MiscStrings.tr there is a template:
...
4
votes
1answer
143 views
Enhancing GraphUtilities' GraphEdit
One thing I use Mathematica for is building molecular graphs.
Until now, I've been content with generating an adjacency matrix from SMILES data, and passing that to ...
11
votes
4answers
287 views
Assessing argument type in set delayed function definitions
I'm wondering how to properly assess the type of arguments passed to functions defined with :=. I want my functions to be the most efficient, unambiguous and clear ...
11
votes
1answer
169 views
Programmatically minimize mathematica?
I can minimize a notebook easy enough with Mathematica code, but how does one minimize all of the Mathematica front end? Just as if you clicked the minimize button on the menu bar? This is for ...
4
votes
1answer
223 views
Importing tabular data that has been exported from Evernote
In Evernote you can embed HTML tables in the note. You can then export them to an xml format with the extension enex. I am trying to get the data from the table imported into Mathematica. Here is the ...
10
votes
3answers
318 views
Drawing outside Plot area
I want to programmatically draw some objects outside the Plot area in my Plot's Epilog, like in this dummy:
I found PlotRangeClipping and hoped that would be the ...
10
votes
1answer
138 views
Notebook with a WindowOpacity too small becomes “click-through” for mouse
I created a notebook and was manipulating its WindowOpacity option:
...
7
votes
1answer
145 views
35
votes
2answers
2k views
Programmatic approach to HDR photography with Mathematica image processing functions
The High dynamic range imaging (HDR or HDRI) direction in photography and image processing became very popular recently. Besides obvious photo art applications (see examples), there are many great ...
5
votes
1answer
487 views
Complex number operations: telling Mathematica variables are real
I want to do Conjugate[a + b*I], but when I do that, the solution is
Conjugate[a] - I*Conjugate[b]; when for me, a and b are ...
3
votes
1answer
165 views
How to highlight various parts of a plot
I'd like to show students a graph of a function, say $(x,y)\mapsto\sqrt[3]{x^3+y^3}$, and then highlight its various properties connected with (non)differentiability at certain points etc. Having ...
13
votes
1answer
394 views
Programmatically move the cursor to a desired location on the screen
Is it possible to set/move the mouse pointer's location directly from Mathematica without using external tools like Run["xdotool mousemove x y"]?
9
votes
2answers
303 views
Take screenshot of the entire desktop using Mathematica
Is it possible to get a screenshot of the entire desktop directly in Mathematica?
I am on Ubuntu running Mathematica 8. For some reason GUIScreenShot[] fails. But ...
7
votes
1answer
251 views
Very fast way to do a coordinate frame transform
I need a function that rotates and translates a huge amount of line segments.
For example, I have a set of line segments in the form {{x0,y0,z0},{x1,y1,z1}}
...
12
votes
1answer
317 views
Is it possible to produce anaglyphs with Mathematica?
I'd like to prepare some presentations in Mathematica to help students visualize functions of two variables (it's a usual calculus course). I thought it would be both cool and useful to have the ...
1
vote
1answer
115 views
Omit part of a 2D plot [duplicate]
Possible Duplicate:
Generating a broken or snipped axis in ListPlot
I am interested in removing a part of my plot, after searching around I could not find any questions concerning this ...
13
votes
1answer
395 views
Unique[] symbol not properly tracked
In a nutshell, why does this work (change y and see how the value updates)
...
4
votes
3answers
379 views
Reversing one axis in Plot3D
When I rotate my 3D plot to the desired viewpoint my X axis runs from 1 at the left to 0 at the right. How can I mirror my plot so that 0 will be at the left and 1 at the right?
Extra credit: how ...
3
votes
2answers
166 views
Creating a Nearest function programmatically
I've been trying to work out how to create a Nearest function programmatically. My goal is to produce something similar to this, a hand-assembled function:
...
5
votes
4answers
518 views
Change variables in differential expressions
I have a fairly complicated differential expression in terms of a variable r and two unknown functions of r, B[r] and n[r]. I want to do a Taylor expansion of this around r=infinity. I want to do this ...
6
votes
3answers
1k views
Plotting contours plot for f(x,y,z)=c
I have the following question: I have a file that has structure:
x1 y1 z1 f1
x2 y2 z2 f2
...
xn yn zn fn
I can easily visualize it with Mathematica using ...
-5
votes
3answers
259 views
Constructing lists by applying functions to another list
Suppose f is a function of two variables: $f = f(x,y)\quad$ and $L$ is a list. Could someone help me in defining a list of the form:
$D = \{f(x,y)\ |\ x \in L,\ y \in L\}$
I tried this:
...
6
votes
1answer
87 views
Importing parts of Packages
Some programming languages offer the possibility of importing a single function from a library, as in
from x import y
I'm looking to import only one function ...
3
votes
2answers
221 views
Rectangle wave OK in calculations, wrong in Plot
I have a Piecewise function consisting of two rectangle waves with different duty cycles:
...
7
votes
2answers
337 views
Expected Value - Mathematica
I would appreciate if one could help me with the following Mathematica problem:
Assume $X$ is an exponential random variable with unit mean ($f_X(x)=e^{-x}$, $x>0$). I want to calculate expected ...
8
votes
2answers
225 views
Sum or Product with Exclusions
Is there a built-in feature for handling things like:
$$\sum_{i=0}_{i\ne j}^n\frac{a-a_i}{a_i-a_j}$$
and
$$\prod_{i=0}_{i\ne j}^n\frac{a-a_i}{a_i-a_j}$$
or should I work out some sort of Do ...
2
votes
2answers
117 views
How can a Button be shifted to perform its action
I have a Panel with 4 Inputfields and a Button. When a ...
20
votes
1answer
307 views
Open two copies of the same notebook
Is there a way to open one notebook in two (or more) different windows? This can be helpful when working with a long notebook and one wants to edit one part of it while looking at a different part. ...
9
votes
1answer
466 views
I failed to solve a set of one-dimension fluid mechanics PDEs with NDSolve
@DNA
The fluid here has been assumed as single component perfect gas i.e. it obeys the equation P=ρRT, the thermal conductivity is assumed as a constant, so the equation is:
...
12
votes
4answers
234 views
The gap between MapAt and ReplacePart for 2D data tables with headers
Consider a relational table derived from survey data, where each column ("001-01" ...) represents a responder and each row (...
8
votes
1answer
203 views
Can JavaScript query the actually used dimensions of an HTML embedded CDF?
I have an HTML embedded CDF on my website. The size that is actually being used up by the single manipulate in the CDF changes when you use the CDF; you can make more sliders appear, and then it will ...
20
votes
1answer
339 views
Convert Graphics3D containing BSpline to polygon primitives for export to 3DS?
Graphics3D[] objects created with BSpline functions will not export to 3DS format, which only supports the more basic primitives. Is there any straightforward way ...
6
votes
2answers
303 views
Symbolic manipulation with unevaluated sums
If I have two expressions with sums in them, like this:
$$\begin{align*}
b&=\frac{\sum_{i} (x_i - \bar{x})(y_i -\bar{y})}{\sum_{i}(x_i -\bar{x})^2}\\
r&=\frac{\sum_{i} (x_i - \bar{x})(y_i ...
11
votes
2answers
405 views
Trying to fit an unknown extreme distribution
First up, I'm quite new to Mathematica so any hints on better code would be greatly appreciated.
I have some histogram frequency data from an unknown distribution that I'm trying to fit. Here's the ...
3
votes
1answer
161 views
Importing file with UCS-2 Little Endian codification
I'm trying to import a text file with UCS-2 Little Endian codification but I can't read it correctly. There's any hidden option to read this files ??
I'd tried with ...
14
votes
3answers
399 views
Grabbing a number of characters around a string pattern
If I have some string data:
text = StringTake[ExampleData[{"Text", "DeclarationOfIndependence"}], 400]
"When in the Course of human events, it becomes ...
4
votes
1answer
536 views
Solve system of equations related to perspective projection
I'm trying to solve system of equations.
I have 4 points before perspective projection and after and I whant to obtain matrix of perspective projection $m_{i,j}$ ($x,y,u,v$ are known , $m_{i,j}$ ...
10
votes
2answers
232 views
Proper way to add vertices to an adjacency matrix
I'm looking for a robust way to add vertices to a graph by modifying its AdjacencyMatrix.
Here's what I have so far:
...
11
votes
5answers
420 views
How to perform a depth-first preorder traversal of an expression?
Due to confusion of terminology on my part I asked the wrong question before.
Since it has already received other answers I shall not edit it, but instead ask the question I meant to in the first ...
4
votes
3answers
329 views
ContourPlot - plot contour lines for minimum of list of functions == 2nd minimum of list of functions
I have a list of (ten or so) functions of two variables (x and y, say). I would like to plot the boundaries on the x y plane where two functions have the same value - but only the two functions in the ...
15
votes
1answer
238 views
What is Sub Mathematica?
When looking at the locally available licenses, I see four entries: "Mathematica", "MathKernel", "Sub Mathematica" and "Sub Mathkernel". Now "Mathematica", "MathKernel" and "Sub Mathkernel" are clear, ...





