All Questions

3
votes
1answer
209 views

Evaluation of self-defined functions

I defined a function that I call disc which I want to minimize later. The function is defined as ...
1
vote
1answer
392 views

How do I use a matrix that has a variable?

I seem to be getting an error whenever I try running this piece of code. Matrix12[n_] := {{1, 0}, {0, {\[Kappa]1[n]}/{\[Kappa]2[n]}}} I've already defined the ...
6
votes
3answers
473 views

How to ensure that Polygon[list] plots a simple polygon?

Consider the following code which plots a triangle. p = {{0, 0}, {.2, 0}, {0, .2}}; {Cyan, Polygon[Dynamic[p]]} // Graphics Then adding (for example) ...
53
votes
11answers
9k views

How to check if a 2D point is in a polygon?

Background: I use code from An Efficient Test For A Point To Be In A Convex Polygon Wolfram Demonstration to check if a point ( mouse pointer ) is in a ( convex ) polygon. Clearly this code fails for ...
2
votes
1answer
182 views

Orthogonalize method, keeping to binary vectors

The built in function: Orthogonalize[m] where m is a list of vectors returns a orthogonal basis for m. However, I want to stick to the binary field. However, I ...
1
vote
3answers
728 views

Span of a set of vectors over a given field

Could anyone help me find a function that takes as inputs: a set $S$ of vectors and an integer $q$ and outputs: the Span of $S$, where $Span[S]$ is a vector space over the field $F_q$. If its ...
1
vote
2answers
167 views

Using patterns in ReplaceAll to extract elements from tuples at arbitrary depths

Please consider the following: I need to extract from MyList all last parts of each 3-tuple. ...
9
votes
2answers
232 views

Strange results while nesting scope constructs?

I did a handful of tests with Block, With, and Module and had a couple of new surprises. ...
-1
votes
1answer
262 views

Speed Up SphericalPlot3D

I was wondering if I could speed up SphericalPlot3D? I tried editing PlotPoints, and ...
1
vote
1answer
135 views

How to switch between different CDFs in CDF Player?

I recently got a Mac. It has CDF Player, but not Mathematica. How do I get CDF Player to switch between different CDFs on OS X Lion? Edit I forgot to mention that I want to know how to switch ...
4
votes
2answers
227 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
439 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
225 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 ...
6
votes
0answers
199 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
213 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
183 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
272 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?
4
votes
1answer
289 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
760 views

Map a 3D plot into plane

I have a 3D plot like: ...
5
votes
1answer
111 views

How to insert or use the PackageTemplate?

In the system resource file MiscStrings.tr there is a template: ...
4
votes
1answer
180 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
485 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
221 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
343 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
910 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
147 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
178 views

Is this a good way to assign a Solve result to a function?

My code: ...
53
votes
3answers
6k 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 ...
9
votes
1answer
3k 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
344 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 ...
20
votes
1answer
792 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"]?
11
votes
2answers
537 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
454 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}} ...
16
votes
1answer
462 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
273 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
434 views

Unique[] symbol not properly tracked

In a nutshell, why does this work (change y and see how the value updates) ...
4
votes
3answers
698 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
252 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: ...
6
votes
4answers
2k 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 ...
7
votes
3answers
3k 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
411 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: ...
7
votes
1answer
124 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 ...
5
votes
2answers
324 views

Rectangle wave OK in calculations, wrong in Plot

I have a Piecewise function consisting of two rectangle waves with different duty cycles: ...
8
votes
2answers
553 views

Expected Value: Strange/unexpected result

Assume $X$ is an exponential random variable with unit mean ($f_X(x)=e^{-x}$, $x>0$). I want to calculate the expected value of $\frac{1}{X}$. Since $X>0$, I am expecting that ...
16
votes
2answers
1k 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 ...
2
votes
2answers
124 views

How can a Button be shifted to perform its action

I have a Panel with 4 Inputfields and a Button. When a ...
28
votes
1answer
785 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. ...
11
votes
1answer
703 views

I failed to solve a set of one-dimension fluid mechanics PDEs with NDSolve

The fluid here has been assumed as single component perfect gas i.e. it obeys the equation $p=ρ R T$, the thermal conductivity is assumed as a constant, so the equation set is: ...
12
votes
4answers
331 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
278 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 ...

15 30 50 per page