# All Questions

1k views

### Combining 2D slices into a 3D plot

I am currently trying to combine several 2D plots into one big 3D plot. The 2D-plots are simply input-results from calculations (so these things have 2D coördinates (x,y)). The results depend on an ...
236 views

### How to keep the non-overlapping parts when aligning images?

I would like to stitch together a pair of images. For example: ...
185 views

### How to track Part of Symbol or How to symbolize Parts of Symbol without copying data

Let's create simple function: SetAttributes[h, HoldFirst]; h[data_] := Dynamic[Grid[data], TrackedSymbols :> {data}] test = RandomReal[1, {2, 2}]; h[test] ...
662 views

### How to transpose x and y axes on a LogPlot?

Consider the following simple LogPlot: LogPlot[Exp[x],{x,0,5}] Is there a nice way to switch the axes of a LogPlot? I'm aware that plotting the inverse ...
337 views

### Accidentally corrupted graphics (?) data of notebook — now it won't open

In the process of editing my scripts' variable names with a haphazard "replace in all open files" in my text editor, I accidentally replaced portions of graphics data in a notebook (and I believe this ...
291 views

### Analysis of many similar x-ray Images

From a 3d x-ray scan, I have many similar slices to analyze. Is there a way to determine the position of the three rectangles and the inner circle?
407 views

### Find positions of duplicates that are neighbours

Assuming the following list {1,2,3,3,5,6,3} I would like to get the position of values that are next to each other and are duplicates. That is, the output should be {3,4}. Thank you for any help. ...
844 views

### efficient way to give nearest neighbour and next nearest neighbour of every point in a point set

Suppose we have a point set, the points are labeled 1,2,3,....n. And p[i] is the coordinate of the point. Now I want the label of nearest and next nearest point ...
3k views

### Solving a system of linear equations modulo n

I have a system of linear equations $$a+b+c \equiv 31 \pmod{54}$$ $$4a+2b+c \equiv 3 \pmod{54}$$ $$9a+3b+c \equiv 11 \pmod{54}$$ What should I input (I'm using ...
608 views

### Identifying when two graphic objects overlap

I'm designing a small demonstration that helps to visualize the reason behind shaping an electrode that is used to probe a surface: ...
339 views

### Riemann-Spherical Projection of Network onto the $\mathbb{R}^2$-Plane

I'm trying to find a way to plot the graph ...
806 views

### Visualizing vector-spherical waves

This is a follow-up question to this one on visualizing vector-spherical harmonics. This time, I would like to visualize the vector spherical waves (including the radial dependence). The functions ...
1k views

### How can I mesh a solid cylinder with triangular or tetrahedral elements

I need to plot triangular mesh on a cylinder. However the function Cylinder doesn't have a mesh option. By using ...
622 views

### TensorContract of inverse matrix

Matrix inverse in mathematica If $A$ is an invertible $n \times n$ matrix, then $A\cdot A^{-1} = I$. To get this statement in Mathematica, you need the assumption ...
235 views

### FontSubstitutions: how do they work?

I'm puzzled by FontSubstitutions. The help says this: FontSubstitutions is an option for Style and Cell that gives a list of substitutions to try for font ...
341 views

### How to view all graphs available in GraphData?

Is there a "gallery" view of all the graphs available in GraphData? I realize that some graphs may not lend themselves to such representation (e.g. some may have ...
451 views

### How to efficiently get the value from form UI built with dynamic InputField

Here is the code that I used to make a tabular UI. ...
1k views

### remove -1 values from a list

I would like to turn a list which looks like this one: {{-1, -1, -1}, {-1, 2, 3}, {-1, -1, 2}, {2, 3, 4}} into one which looks like that one: ...
1k views

### How do I prevent fonts sizes and line weights from scaling in exported graphics?

It's common to export graphics from Mathematica that are subsequently scaled to various sizes that cannot (at least not conveniently) be anticipated. This is problematic in cases where (as is common) ...
635 views

### How to compile the code for generate Pythagorean_triple?

I am finding Pythagorean_triple, it worked slowly. I tried to compile, but it gives some warnings. I also use "Case" or "Do" ,both of them failed.I'm sure my CCompiler has been set correctly. How can ...
496 views

### Setting default Mathematica version

Is there a way to set the default Mathematica version? I would like to run both versions 7 and 8 (on a Win7 PC), but when version 8 is installed it takes priority. Clicking on a notebook ...
647 views

### Problems getting clean sunrise, sunset, civil, nautical and astronomical twilight data

If in a notebook you enter: ...
1k views

### How to add more levels to Outline notebooks

The Outline stylesheet only seems to cover 6 levels of depth. Is there any way to increase that? Here's an example. Hitting tab on the last level just indents its content, but doesn't add another ...
1k views

### How to find the smallest root

I have a continuous, differentiable, monotonic, bounded function called F[t]. If t -> Infinity then ...
569 views

### Threading a compiled function over multiple arguments of different lengths

I am interested in threading a compiled function over multiple argument lists of different lengths. I will explain this in two steps: Suppose f is some function. Then one can define another ...
732 views

### How to draw multiple coordinates on mathematica?

For example: How can I draw such kinds of coordinates? Thank you~
53 views

### Run several input cells in parallel

I have a notebook with several input cells that produce data which is then plotted into separate graphs. Since I do not want to save the results, because it makes the file huge, I keep the ...
200 views

### Trouble with shooting method for a 4th-order differential equation

I'm trying to solve the following forth-order ODE with the shooting method: \frac{1}{5}(y-2xy^\prime)=\frac{1}{x}\left\{\frac{xy^\prime}{y}+xy^3 \left[\frac{(xy^\prime)^\prime}{x} \right]^\prime ...
156 views

### Naming convention for symbols exported from package

I know this is a little opinion based, but so is Mathematica style guide and similar topics. The issue is important so I think this topic will be beneficial for future visitors. Q: So ...
124 views

### RGBColor, ColorSlider and ColorSetter

A single RGBColor expression displays as a little square, showing the color. I just found that this little square is both a tooltip and a button. It seems to be new ...
254 views

### ToElementMesh problem on Ball defined by ImplicitRegion?

Bug introduced in 10.0 and fixed in 10.2 Could any one please confirm the following bug in mathematica 10.0.2 ? If I define this ball ...
180 views

### Choosing which edges of the box to show in 3D graphics

Is there a way to explicitly choose which edges of the bounding box to show when plotting something with Boxed->True? For instance, a plot like ...
292 views

### Extruding a wierd 2D shape to make a prismatic 3D shape

I have the outline of a 2D shape defined by a periodic radius R[θ]. I would like to extrude this linearly to a prismatic 3D object that has my cross-sectional ...
142 views

### Tools for MathLink traffic analysis?

I noticed that the documentation for LinkSnooper says that it is "obsolete". I don't have any experience with this tool, but I thought it looked interesting after seeing results it was able to provide ...
234 views

### How can I download a tweeted image given the tweet id?

ServiceExecute[] supports sending an image via "ImageTweet" i.e. posting an image in a tweet. But how can I achieve the reverse of this and download the image given ...
160 views

I have some packages that uses database connections inside it, let's call it ConnPackage. The connection IP is a public package variable, and has a default value: ...
230 views

### SmoothHistogram inside Show doesn't respect plot range clipping?

You can try this for yourself. Run the following code a couple of times: ...
173 views

### Using a held option

Woud there be an elegant way to use a held option ? For example if I need to pass by reference several variables but I don't always need all of them, it can be useful. For example if I want to append ...
278 views

### Question in ParametricPlot3D, how to join the minima of a {x,y} function

Thanks to my previous question I have plotted the function with the following code: ...
358 views

### Total by a criteria

I am developing a weighted KNN algorithm. In a step, I need to do the sum of weights of each class. For example: ...
290 views

### Problems extending NelderMeadMinimize into 2D

Update The eventual route I followed was to adapt a version of the NM-simplex written in C and link to it with MathLink. Once I've tested this out fully I'll post it here. I've been playing around ...
355 views

### Keep kernel running for execution of scheduled task

How can I keep a kernel running until all scheduled tasks have completed? For example upon running the following script bazinga.m: ...
601 views

### Map of Swedish regions?

There have been some questions dealing with how to draw individual US states since such data doesn't come with Mathematica through its CountryData which offers ...
763 views

### How to display each step of an A star algorithm?

I wrote a pathfinding program: A*, which is an extension of Dijkstra. I want to see the result of each step at a time. Which function should I use? The main program is the notebook Astar, which is ...
220 views

### Save all input History in a log file

I would like to write some code in my init.m to save all inputs {In[1],In[2],...In[lastone]} right before I close the kernel (or exit Mathematica). Such a script ...
1k views

### How to increase Spectrogram resolution?

I have a time-domain signal that I want do a time-frequency analysis on it. When I tried the Spectrogram, I always get very low resolution. For example: I have a ...
238 views

### Consecutive Print to target same output Cell

Is it possible to conveniently direct the output of consecutive Print statements to the same output without actually accumulating the output in a temporary string/variable. This would be useful in ...
454 views

### Using MathKernel without echoing a window

I use M9 under windows 7 on a command prompt as: MathKernel -noprompt -script file.m On execution, there is a like a kernel window opened and then closed immediately. How can I avoid this window and ...
Let's assume $x^{10}+x^5+1$ has a factor $x^2+ax+b$ Then, If $x^2=-ax-b$, $x^{10}+x^5+1 =0$. If we successively apply $x^2=-ax-b$ to $x^{10}+x^5+1$, we can make $x^{10}+x^5+1$ to degree 1, ...