All Questions

10
votes
2answers
770 views

Creating a realtime MIDI Out

I have a live stream of notes and note velocities using SoundNote and SoundVolume. My problem is that I have no idea how to ...
3
votes
2answers
402 views

Local variables

I'm trying to use Modules together with functions. tmp2 = x^2 + 1; f[y_] := Module[{x = 1}, Evaluate[y tmp2]] This works when ...
3
votes
1answer
278 views

How do you get Weisstein’s Hyphenate package to run?

I've put Eric Weisstein's Hyphenate.m package in $UserBaseDirectory/Utilities; installed the requisite ...
3
votes
3answers
161 views

Simplifying already defined symbols

Consider the following code: ClearAll[x, y] x = y; y = 2; ?x ?y This will store $x$ being equal to the variable $y$, and $y$ having the value of $2$. Now switch ...
3
votes
1answer
210 views

Avoid crash in recursive Dynamic

With the following Dynamic cell, I can reproducibly crash Mathematica, so do not try this unless you have saved all your work! ...
6
votes
5answers
3k views

Computing eigenvectors and eigenvalues

I have a (non-sparse) $9 \times 9$ matrix and I wish to obtain its eigenvalues and eigenvectors. Of course, the eigenvalues can be quite a pain as we will probably not be able to find the zeros of its ...
16
votes
4answers
939 views

Subplots with connector lines

I am looking for advice from people who have more experience in this area on what is the best (simplest, least effort) way to create a graphic like the following: This is a rough mockup made in a ...
2
votes
1answer
3k views

Visual Studio Express 2010 on x86-64: libcmt.lib missing

The CCompilerDriver documentation explains that to use visual studio express on 64-bit targets, it's necessary to install the windows SDK after installing visual studio. I have done this, first ...
9
votes
1answer
541 views

What is the best way to clip a graphic to a region?

What is the best way to clip a graphic to a certain region? Here's a very simple implementation to show what I mean: ...
5
votes
1answer
404 views

Using physical dimensions in Mathematica DSolve

I would like to calculate a system of two differential equations in Mathematica using DSolve, like: ...
11
votes
4answers
570 views

How to automate a FrontEnd return?

I use some custom shortcut keys in KeyEventTranslations.tr. One is for the Delete All Output function: ...
7
votes
2answers
874 views

Creating Plots for a Family of Solutions

I am wondering how do you set the parameters appropriately for $a_n,\,\alpha,\,\text{and }b_n$ to plot the family of solution of: $u_n(r,t) = [a_n\cos(k_n\alpha t)+b_n\sin(k_n\alpha t)]J_0(k_nr)$ ...
14
votes
1answer
240 views

How to make a function like Set, but with a Block construct for the pattern names

How can we define a function that works like f[x_]=ComputeSomething[x] and treats x as a variable that does not have a value? ...
17
votes
5answers
3k views

How do I plot a plane EM wave?

I would like to display an electromagnetic (EM) wave. I have written code that works, but it does not "shade" the area between the graph and the axes. Both the ...
12
votes
2answers
761 views

Keeping Text Size the Same Throughout Entire Notebook File

Is there a way in which when you choose to format the size of the font within your notebook, for a particular cell, when you go into another cell, the default size font (12pt) will not be ...
0
votes
1answer
351 views

Symbolic Optimisation

I'm trying to solve symbolically the following optimisation: $$ \min_{q_uu}\ \Biggl[ q_u q_{uu}\psi B_{uu} + q_u q_{ud}\psi B_{ud} + q_d q_{du}\psi B_{ud} + q_d q_{dd}\psi B_{dd} $$ $$ + ...
3
votes
3answers
3k views

Product of elements within a list

Please Consider : list={{5,2,6},{2,8,3}} I need to get the product of all the element within list : As of now I do this : ...
21
votes
1answer
842 views

Using .NET 4.0 from NETLink

Using Mathematica 8, I can check the version of the .NET framework used by NETLink as follows: ...
16
votes
2answers
3k views

Delete the current notebook cell using the keyboard

Is there another way than pressing Ctrl+. until the whole cell is selected and then pressing Del? If this is not built in, can I create some sort of a global macro to do this and bind it to a ...
7
votes
1answer
617 views

Hankel Transform integrals won't work in Mathematica

I'm trying to do this integral, which is shown on the Wikipedia page on the Hankel transformation: $$\int_0^{2\pi}\mathrm d\varphi\;e^{\mathrm im\varphi}e^{\mathrm ikr\cos(\varphi)}$$ The answer is ...
36
votes
4answers
5k views

How do I save a variable or function definition to a file?

Is it possible to save a function which was created via Interpolation of some data in such a way that I can use this function in a new Mathematica session without ...
12
votes
2answers
597 views

Is it possible to use the LevenbergMarquardt algorithm for fitting a black-box residual function?

I have a black-box multiargument multiparametric function of the type SRD[dataPoint_List,params_List] which accepts experimental data along with the parameters of ...
111
votes
2answers
4k views

Implementing efficient multiple undo

At the time this question was asked, version 10 was not out yet. The Front End of Mathematica 10 does have multiple undo, see the answer by John Fultz. The Mathematica Front End's built-in Undo ...
21
votes
0answers
450 views

Changing FrontEnd automatic scrolling in version 8

In Mathematica versions < 8, the FrontEnd has a very intelligent behavior: On evaluation, it by default automatically scrolls down the Notebook window to the last printed Output cell but also ...
10
votes
1answer
282 views

How to work around incorrect tooltips in plots exported to HTML

This is an issue that I always wanted to investigate but haven't gotten around to solving yet: The tooltips for contour lines in a plot like this can be very useful in the Notebook interface: ...
4
votes
5answers
2k views

Using implicit differentiation to find a line that is tangent to a curve at a point

A few days ago I asked about using differentiation to find a line that is tangent to a curve at a given point. J.M. provided a very elegant way to solve these kinds of problems in Mathematica. Now ...
11
votes
2answers
248 views

How can you stop ordering of InputField entries?

I have: InputField[Dynamic[d]] Dynamic[d] If I enter e.g. a b x^5 h m the entry automatically gets sorted, as per screen ...
16
votes
2answers
875 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
381 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
778 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
670 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 ...
37
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
610 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 ...
20
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
329 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
800 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
797 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
4k 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
232 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
370 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
618 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
899 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
540 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
407 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? ...
17
votes
1answer
644 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
495 views

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

Problem / background: consider the following code snippet. ...

15 30 50 per page