All Questions

61,566 questions
496 views

How can Mathematica be used to detect an area surrounded by the most lines?

I have an array of lines that produce random shapes. These lines define edge boundaries from an array that I would like to use to reconstruct the main feature of the array. Can Mathematica find the ...
730 views

Time approximation of decrypting RSA algorithm

I've written a function that encrypts a text using the RSA algorithm. It then decrypts it using prime factorization, and takes the time it took to decrypt it and puts it in a vector together with the ...
1k views

How to retrieve the parameters calculated and used by ImageAdjust?

When ImageAdjust is called with an image, i.e. with one parameter, it returns an automatically adjusted Image. I would like to ...
3k views

Filling between two 3D surfaces

I know it is possible to create a filling in between two curves on a 2D plot, but is it possible to do the same in 3D? My attempt like this: ...
283 views

Cannot calculate with Dynamic variables in a grid

This is a prototype of a grading scheme. In reality it is bigger. The 10 pts in initPtsPartA comes from the school. The output cell should be deployed as a CDF ...
768 views

Export grayscale png

The help for the Export function is absolutely unclear. How can I specify options for my output format? According to the documentation, PNG supports grayscale ...
1k views

How can I convert a formatted text cell to latex code?

I have a formatted text cell, I want to export it as latex. How can I do that? Since copy as LaTeX doesn't work, I thought of pasting it into a string and exporting, but it's a no go: ...
693 views

How to collect terms of a given type (with subscript and power) in an expression?

Suppose that I have an expression: ...
282 views

Force size in pixels of plot area excluding axes and labels

I have a matrix where each element represents a pixel. I want to plot the matrix (possibly with ArrayPlot). To suppress aliasing in the final graphic (which I will ...
744 views

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

If in a notebook you enter: ...
790 views

Automatizing PSfrag export

I'm in the early phase of creating a Mathematica function (or package) that exports graphics such that they can be used with $\LaTeX$'s PSfrag. The goal Ideally, the function should take a graphic ...
147 views

“Hiding” cells until the first cell is evaluated

This question is based on my earlier question about randomizing labs for students in my computer lab courses. There a perfectly good solution was posted; however, because of privilege problems, I ...
653 views

Forget past outputs to free memory [duplicate]

While tinkering with a notebook that loads a large chunk of data in memory, I noticed that if I run it multiple times, the past chunks reside in memory. I understand that the reason (or one of) for ...
2k views

Sparse convolution of sparse arrays

The documentation for ListConvolve mentions that "ListConvolve works with sparse arrays", which is true. The result, however is never sparse, eg: ...
4k views

How do I find the degree of a multivariable polynomial automatically?

I have a very simple question which appears not to have already been answered on this forum. Is there built-in functionality that returns the degree of a multivariable polynomial? For example if the ...
264 views

Parallel linear algebra with arbitrary precision

Is it possible to do parallel linear algebra with arbitrary precision within Mathematica (in a simple manner, as is done for the machine precision)?
683 views

Optimize inner loops

I'm Mathematica newbie so please be gentle :) I have this, heavily non-optimized part of code, which I would like to speed up. I have put all matrices to be RandomReal, but in my code they take ...
153 views

How can I know if a pattern corresponds to a string pattern?

What would be the best way to detect if a pattern corresponds to a string pattern ? An invalid string pattern p would lead to an error in ...
327 views

Performance of a Do-Loop of variable length

If I'm changing a basis depending on a (non quadratic) matrix $\mathbf{M}\in\mathbb Z^{d\times k}$ and some $\mu\in\mathbb N^k$, i.e. i have an array a of the same ...
724 views

Add values to a PlotLabel; use text characters for PlotMarkers in DiscretePlot3D

I have a plot like this: Table[Plot[a*x^2/4, {x, 0, 5}, PlotLabel -> "a=" a], {a, 1, 5, 1}] I want to label the plots as ...
364 views

Exported graphics texture to eps is too dark

Why is the exported graphics eps file so dark? It looks much lighter (and better) as the Mathematica output appearing the notebook. After running ...
783 views

How to batch rename a directory of files?

I have a directory of files with the pattern: "some_number.some_name.pdf" I want to remove the "some_number." part from all the ...
424 views

Restrict SystemDialogInput to open certain file types

The documentation for SystemDialogInput shows how to restrict the types of files shown. SystemDialogInput["FileOpen",".nb"] .....
484 views

Coulomb/kepler potential dynamics. NDSolve breaks

I've been trying to do a simple dynamics in coulomb potential (electron(s) around a nucleus). My equations break down. I think it's because of 1/0. is there a way ...
196 views

Projecting Reference Lines in a SmoothHistogram3d Surface

What is the best way to draw a path (red color, dashed) along the surface of the smoothHistogram3D. Assume the paths desired to be the X=0 and Y=0 Axes. ...
334 views

Mathematica Typing Effect

Here is a Typing Effect in javascript. I could only implement a very simple one: ...
239 views

Error in Compiled function at runtime in spatial competition model

I just did a model of spatial competition between two species with different competitive ability & dispersal rates on a lattice with variables nrs of individuals per site. To speed it up I tried ...
961 views

Specifying parts from lists for plotting using Show

I have the following data: ...
621 views

Generating a function which outputs possible chemical reactions

I want to make a list of chemical reactions and I write them down in a $\require{mhchem}\LaTeX$ format. They are of the following form NA_n^i+MB_m^j \rightarrow \hat NA_{\hat n}^{\hat i}+\hat MA_{\...
450 views

Histogram of runs

What I would like to do is generate a histogram of the consecutive time spent under a level. For example if the level I was interested in was 1.0 and I had this data; ...
163 views

Exporting Graphics3D is not complete

Bug fixed in 9.0.1 When I export the result defined as the variable pot1 to pdf, the lower contour plot isn't showing. How do I fix this? ...
307 views

Doing an Interpolation through a list of lists into a single function

Suppose I have a list of lists, i.e. list = Table[{x, x^ k}, {k, 1, 10}, {x, 0, 1, 0.05}]; and I want to interpolate each of the lists by a function using ...
2k views

How do I cut down on file size of exported eps without losing quality?

I need to import the following to eps so that I can put it into my TeX file. The problem is two-fold: the exported file looks terrible (unlike the Mathematica output), and secondly, the file size is ...
13k views

Placing a ContourPlot under a Plot3D

I would like to combine a 3-dimensional graph of a function with its 2-dimensional contour-plot underneath it in a professional way. But I have no idea how to start. I have a three of these I would ...
2k views

Possible to evaluate only selected cells?

Is it possible to evaluate only the selected cells programmatically that I am interested in? Say in current cell to bottom of the notebook, instead of evaluate notebook or cells?
2k views

Rasterizing a plot make axes ticks invisible [duplicate]

I've evaluated this code: plot = Plot[x, {x, 0, 10}]; g = Rasterize[plot, ImageResolution -> 300]; Everything looks good except the ticks (on the axes); they ...
1k views

Kinect on Mathematica

I saw on the internet a lot of nice experiments with Microsoft Kinect. I just bought one and would like to know if someone here has been able to use it with Mathematica. The main idea is to been able ...
633 views

Locators in Manipulate not moving properly

I thought a simple Mathematica kerning machine (for adjusting the space between characters) would be interesting, but I'm having trouble with the locators. (There are a number of other questions ...
79 views

How to obtain xyz-axes of same length? [duplicate]

Possible Duplicate: Controlling the 2D $x–y$ aspect ratio of a 3D plot I am plotting 1000 points in a 3-dimensional cartesian coordinate system, the plotting range for the x, y, z axes is set to {...
801 views

Numerically finding a derivative jump of a function

How would I numerically find where a function has derivative jumps? In particular, I'm working with this function: ...
252 views

Error changing edge thickness in a GraphPlot

I'm having some problems with the Mathematica graphics inspector. I want to make a graph with the following code: ...
1k views

Color mixing or blend

Color mixing seems not only one type. Here is RGB_color_model I wrote this one: ...
274 views

I'm using one of Mathematica's built-in stylesheets, "Standard Report". When I enter an expression into an input cell and evaluate it, the input is shown with a white background, while the output has ...
826 views

plotting evolution of points in the same plot

I am trying to plot the points (i,j,k) as they are generated in the loop but in the same plot. The next draws the points in different windows. ...
818 views

Wrapping a rectangle to form a cylinder

I'd like to make an animation showing how we wrap a rectangle to form a cylinder (by joining a pair of parallel sides). Here's my first pass: ...
3k views

Tricks for solving (lots of) coupled nonlinear equations numerically?

I have a system of 6 non-linear (quadratic) coupled equations with 6 complex unknowns \begin{align*} |x_1|^2 + |x_2|^2 + |x_3|^2 &= a\\ x_1 x_4^* + x_3 x_5^* &= b + c i\\ x_1 x_6^*...
1k views

Finding the Centroid of the grid

Im trying to automate the processing of my shooting targets to measure my performance in the range. I was able to process the shots, but I still have to select the center of the target by the use of ...
3k views

Moving the location of the branch cut in Mathematica

According to the documentation, Mathematica chooses the branch cut for $\log(z)$ to lie along the negative real axis. It it possible to change this so that it lies along the positive axis or elsewhere ...