16
votes
2answers
894 views

How can I change the keyboard shortcut for switching the active window?

The default keyboard shortcut (on Windows at least) for switching focus to the next window is Ctrl+F6, and for switching to the previous windows it's Shift+Ctrl+F6. How can I change this to Ctrl+Tab ...
4
votes
1answer
386 views

Get the neighboring vertices and incident edges from a vertex in a graph

I need to get the neighboring vertices and incident edges from a vertex in a graph. I assume NeighborhoodVertices can be used for the former. Anything better? Or ...
3
votes
1answer
796 views

How to write a function to add edges or vertex to a graph

I need to add either a vertex or an edge to a graph, and also sometimes, vertices or edges, or a mixture of the two. How to write a function for this?
14
votes
2answers
675 views

Efficiently collecting results inside a compiled function

When we don't know the number of results that will be generated, the usual way to collect results is Reap/Sow. Another ...
38
votes
9answers
1k views

Injecting a sequence of expressions into a held expression

Consider the following toy example: Hold[{1, 2, x}] /. x -> Sequence[3, 4] It will give Hold[{1, 2, Sequence[3, 4]}] ...
15
votes
3answers
618 views

Measure a DensityHistogram[] pair similarity

I study human vision and more specifically eye-movements. "If we display 2 symmetrical patterns (20 min one after the other), will our gaze distribution be symmetric is my research question." The 2 ...
21
votes
7answers
1k views

How to Derive Tuples Without Replacement

Given a couple of lists like a={1,2,3,4,6} and b={2,3,4,6,9} I can use the built-in Mathematica symbol ...
10
votes
2answers
330 views

Visualizing several long lists of numerical information to see relative frequency

Mathematica has very powerful visualization techniques. However, I'm at a loss at how to best make the following chart readable. ...
14
votes
4answers
821 views

What is the fastest way to locate an image inside a larger image?

let b = let c = How to do: find[c,b] that returns the bounding box of c in b? ...
10
votes
3answers
820 views

Passing down arguments

In R, one can use ... to pass arguments down to another function. For example ...
45
votes
6answers
7k views
13
votes
4answers
5k views

Using FindFit to fit $a\,b^t$: how to avoid introducing complex numbers?

I'd like to find a model $f(t)=a\,b^t$ which matches the following data ...
22
votes
3answers
1k views

Calling IronPython code from Mathematica

I'd like to call some IronPython code from Mathematica using .NET/Link. The problem is that the code lives in .py files, yet from Mathematica I can only load .NET assemblies which are DLLs. So it ...
4
votes
3answers
234 views

Transform vector with lag

Say I have a vector $Z_n$ with and I want to transform it into another vector using this formula: $X_t=Z_t+0.7Z_{t-2}$ The problem is that I am not quite sure how to get that $t-2$ lag in there. I ...
15
votes
2answers
1k views

List of Parallelize[]-able functions

The question is clear and is inspired by this question and the first comment on this question. Although there are many tricks for parallelizing things that are not ...
6
votes
2answers
372 views

Rectangle with rounded edges

Inspired from : Fit an image within a Rectangle [] in Graphics I would like now to fit an image within a Rectangle[] with rounded edges as shown in the example below : Is it possible ?
6
votes
1answer
636 views

Efficiency of ParallelDo when a global variable./matrix is being updated

(Disclaimer: I realize that the addition of matrices a and b below can be done very fast just by typing a+b. The code below is just meant to illustrate behavior similar to what I observe in much more ...
9
votes
2answers
1k views

RootSearch for complex or multiple equations

First the background. I'm trying to solve for the roots of a rather messy complex equation. This is not the exact equation, but it's a decent (simpler) stand in: ...
9
votes
1answer
933 views

Where can I permanently modify $Path?

I've quite forgotten: what file does one modify in order to add directories to $Path globally? Specifically, I want to include ...
8
votes
1answer
551 views

Is there any automatic differentiation package?

I'm wondering if an automatic differentiation package exists for Mathematica. This is what I mean by automatic differentiation.
7
votes
3answers
412 views

RecurrenceTable not evaluated: mathematica just echoes input

Forgive the newbie question... I am trying to create a table of the following system, following the Stirling example in the documentation, but Mathematica just echoes my input. What am I doing wrong? ...
18
votes
1answer
653 views

Module vs DynamicModule for a dynamic variables in a grid. || Spelling Bee

When my daughter asked me help with her spelling homework, for me the obvious thing to do was to write a Mathematica program for it. The words: ...
4
votes
2answers
502 views

How to add fill color to a 2D Graphics object?

Problem / background: consider the following code snippet. ...
3
votes
1answer
252 views

Result of Reduce contains duplicate terms

On my system, the result of this: f[x_] := 2 Sin[x] + Sin[x]^2; Reduce[f'[x] == 0, x] contains the following expression twice: ...
16
votes
3answers
6k views

adding labels to points in ListPlot

Table[{Re[5 Exp[I 5/2 t]], Im[5 Exp[I 5/2 t]]}, {t, 0, 6}] ListPlot[%] This code plots 6 points in the complex plane. To each point I would like to add a label in ...
16
votes
1answer
362 views

Convert GraphPlot[]s with many nodes into something that's human-understandable

This is more of an abstract/creative problem. I think everyone who has played around with GraphPlot, ended up with an image that looks like this, at least once in ...
6
votes
2answers
390 views

Text[] using Graphics

...
3
votes
2answers
178 views

ScientificForm is not being applied

I am looking to compute the value of $\sum^{3249}_{n=58} 2^{n \choose 2}$, but when I try to execute ScientificForm[Sum[2^Binomial[n, 2], {n, 58, 3249}]], I get a ...
9
votes
2answers
3k views

Equation of a line that is tangent to a curve at point

A common problem in the derivative section of calculus texts is "find the equation of the line that is tangent to the curve $y = \ldots$ at the point $P$." To find the line that is tangent to $y = 2 ...
46
votes
4answers
2k views

Using a PatternTest versus a Condition for pattern matching

My last question to the site resulted in several answers that involve using pattern matching in Mathematica, a feature I wasn't very familiar with at the time. I am currently reading Mathematica ...
11
votes
3answers
1k views

Can Eigenvalues[] and Eigenvectors[] be assumed to return the same ordering?

If I do back to back calls of Eigenvalues[] and Eigenvectors[] can these be assumed to order the values and vectors the same, or ...
10
votes
3answers
767 views

How to plot layered graphs?

Given a directed acyclic graph, there is always a possibility to plot the graph as layers, where nodes always send edges into one direction (usually down), to successive layers, and never backwards. ...
11
votes
5answers
671 views

define a function from a list

I would like to create a mapping from a list and I am wondering if there is a slick way of doing it. For example, consider the list ...
5
votes
3answers
322 views

Centrality measures for single nodes

I am producing a graph, generated by a list of adjacent nodes. (The list looks like {1 ->583, 1->2977, 2->14, 4->1293, 5->221, ...}. Each node of my ...
6
votes
3answers
678 views

Arithmetic operation on the value returned by Solve

I want to modify the value that is returned by Solve. Example: SolC1 = Solve[Sin[ π x / L] == 1, x] {{x -> L/2}} I need to add n to x so that x becomes ...
4
votes
1answer
324 views

Which DirichletCharacter is KroneckerSymbol?

If $d$ is a fundamental discriminant, KroneckerSymbol[d,n] is a Dirichlet character modulo $|d|$. Which one is it? If $d>0$ is a prime $\equiv 1\bmod 4$, then ...
15
votes
3answers
747 views

Using results of Reduce

Suppose I have function f: f[x_, y_] := 50000 + x 30000 + y 35000; Now I want to find the x and y when f[]<=200000. I use Reduce: ...
8
votes
1answer
223 views

Day of the week vs time on BoxWhiskerChart

I am completely stuck on how to approach this problem: I'm basically trying to figure out when is the best time to tweet on twitter, based on a list of timestamps: Here are the raw values: ...
9
votes
4answers
1k views

How to sum up subelements of a list of unknown length

I'm simply looking for the {}+{} function for sublist elements of a list: (Parallel sums of elements) ...
87
votes
5answers
7k views

How to compile effectively?

What are the best practices of compiling functions? I understand that this is a vague question, but let me list some aspects that might trigger useful answers. Some of these have already been answered ...
3
votes
2answers
1k views

Importing .txt or .csv financial data

I am trying to import some financial data exported from Excel. You can find the relevant file here : Text File or CSV File This is what the data looks like in Excel : Using the following code to ...
3
votes
1answer
346 views

Take[] and other Mathematica functions with live streams

I have a live video feed that I would like to convert into raw numbers that could be used for a variety of different things. I would also like to do simple operations on these numbers live with as ...
20
votes
3answers
1k views

Deploying Mathematica Content Online

I have the following program at home, which draws on a batch of pre-processed files (that are word frequency text files, compiled using ToLowerCase, ...
10
votes
2answers
477 views

Workbench Profile[] question

I previously posted this question on Mathgroup but received no response I am using Workbench to profile my code. Suppose I have 2 modules, let's call them A, B (they are too long to replicate here). ...
17
votes
3answers
749 views

How to force Compile to return multiple results?

I would like to return two separate values from a compiled function, but Mathematica refuses to use the compiled version. Here is a narrowed-down example: ...
21
votes
2answers
2k views

How to plot planar graphs as such?

A planar graph is a graph that can be drawn in the plane such that no two edges cross. For example, the graph ...
5
votes
3answers
2k views
15
votes
0answers
1k views

Web Browsing Automation with Mathematica

I want to build a bot to automate web browsing, this mean something like: filling forms press "submit" buttons find certain text inside pages and so on... How can I do this with Mathematica? The ...
10
votes
3answers
853 views

Working with PhysicalConstants

I recently found the PhysicalConstants` package. First I thought this was nice, since I didn't have to look up some quantities all the time and copy them into the ...
8
votes
2answers
1k views

ParallelTable and Table do not give same result

I have a question regarding the use of Parallelize. In the help one can read that “Parallelize[Table[expr,iter, …]] (which is ...

15 30 50 per page