# All Questions

605 views

### What function can I use to evaluate $(x+y)^2$ to $x^2 + 2xy + y^2$?

What function can I use to evaluate $(x+y)^2$ to $x^2 + 2xy + y^2$? I want to evaluate It and I've tried to use the most obvious way: simply typing and evaluating $(x+y)^2$, But it gives me only ...
1k views

### When do I use Mathematica, when do I use Gephi, and how do I use them together?

Mathematica has great operations for analyzing graphs but when the graphs are a bit bigger, Gephi seems to be more efficient (at least on my computer) at drawing and analyzing, i.e. visualizing the ...
2k views

### Save and call matrices with large output in Mathematica [duplicate]

If we have the large matrix A=RandomReal[{-10, 10}, {1000, 1000}]; and I need it for further calculation, how can I save it on hard disk and then call for ...
464 views

### How to execute kernel command from Front End?

Documentation for Yuri E. Kandrashkin's OptionsExplorer package says to add the following menu commands in MenuSetup.tr: ...
413 views

### Operations on online files via public URL access

I need Mathematica to access an online public directory via some URL (fake in this case) http://example.com/images and perform operations similar to those Mathematica can do on OS directories and ...
237 views

### Optimising coefficient finding functions

I'm seeking a generalisation to this question, where I am looking to list the coefficients (without repetition) to monomials of the form ...
601 views

### Plotting a contour line in 2d on a 3d surface

I have a list of data which I can plot as a surface with ListPlot3D. Moreover I have a set of other surfaces and I have plotted the projection of their intersection ...
490 views

### what is The Formula behind the Kolmogorov-Smirnov test statistics?

I calculate the Kolmogrov-samirnov test statistic for the following data: ...
539 views

### How to use MathPSfrag package in Mathematica 10?

I am interested to use LaTeX like labels in the plots that I prepare in Mathematica, and hence, I downloaded the MathPSfrag package from this website ...
179 views

### How to fix a PDF line rendering problem in V9

If I run this in V8 ...
547 views

### Preparing 2d plots for publication

When it comes to plotting a data my general attitude is to avoid post processing (say with adobe illustrator) as much as possible. To follow this strategy I would like to prepare publication-ready pdf ...
301 views

### Sorting a large file

I have some huge logs, which are text files, containing up to a million rows each, and I need them sorted. Because trying to import one obviously makes Mathematica run out of memory, we must rule out ...
854 views

### How to optimally solve and generalize this Conway's Game of Life puzzle

I tried solving this using mma. I am aware of this command - Cellular automata. But i don't want to use that coz then there is no challenge. So below is how i did it and my question is can this be ...
274 views

### Grid ItemSize is smaller than expected

If I execute MatrixPlot@IdentityMatrix@100, the result is a good size. However, if I evaluate ...
469 views

### What is the fastest way to replace all zeros in a matrix?

In the following matrix m every 0 should be replaced with a 1: m = {{0,1,2},{5,0,3},{8,0,0}} Desired result: ...
246 views

### ParallelMap and Sow/Reap - not behaving as expected? [duplicate]

Is ParallelMap and Parallelize@Map expected to work with Sow and Reap construct. This is a rather brief toy code to find all Primes just to force the use of Sow/Reap inside Map ...
211 views

### Parallelizing or optimizing a script for calculating the size of all pairwise intersections between collections of sets

I need to speed up or parallelize an operation that looks essentially like this: ...
407 views

### Autoregressive distributed lag model

Could someone point me in the direction of creating an autoregressive distributed lag model in mathematica?
153 views

### How can I determine the hyperlink of a currently opened documentation page programmatically?

Every pages in the documentation has a hyperlink. Here are some examples: ...
1k views

### Quality control when exporting graphics into JPG

If I export a graphics from Mathematica to JPG format the image quality in JPG is visibly lower than that in Mathematica. Is it possible to control and eventually increase the quality of the exported ...
876 views

### Compute the rank of a matrix with variable entries

Say I have a matrix like $$M=\left( \begin{array}{c c c} x & xz & w-2x \\ wz^3 & xy & z \\ y^2-z^3 & x+w & z+x^5 \end{array} \right)$$ is it possible to ask Mathematica ...
285 views

### Is there something akin to “SubgraphIsomorphismQ” in Mathematica 9?

Provided two unlabeled graphs, $G$ and $H$, I would like to test where $H$ is a subgraph of $G$. In other words, I'd like to test whether we can prune some fixed number of vertices or edges from $G$ ...
944 views

### Using PlotLegends

Please don't answer this with "Just trash PlotLegends" or anything like that as I have tried homebrew solutions. I keep running into problems which I can't debug as ...
392 views

### How do I dynamically change Manipulate controls?

What I'd like to be able to do is dynamically change the axis of a 3D plot inside a manipulate. For example if I have a function that has three input variables I'd like a 3D plot using 2 of the ...
208 views

### Delete contexts from a string representation of a symbol

I want to delete the string representing the context of a symbol. For info I need such a functionality in my ShowIt function defined here I'd like to know how I ...
137 views

### How do I force columns in a Grid to be equally spaced?

Suppose that I have this table tab, which I display using Grid. Is it possible to force the columns to be equally spaced? All ...
837 views

### Efficiently exporting many images as a video

I have many .gif images and I would like to export them as a single video file (I prefer .mov, but any video format is fine). But what if I have several tens of megabytes of .gif images? Is it ...
195 views

### How do I plot a filled cylinder in 3D?

All, I'm trying to plot a filled cylinder in 3D using Graphics3D and then take 2D slices of said cylinder. I know that Cylinder is officially 'filled', but the 2D ...
181 views

### ListLogLinearPlot for the whole real numbers

I have the followin data ...
1k views

### How best to embed various cell groups into a latex project?

I'm an author and a coder. I want to reference various parts of my notebooks in my latex project. I've tried doing the following, using a post on the latex side of this problem. I'd like to solve it ...
241 views

### Font difference in mathematica 9 and 10 after export to illustrator

It seems WRI has changed the way fonts are dealt with in Mathematica 9 and 10. The following command Export["test.eps", "This is a nice formula"] yields this ...
207 views

### How to put the tensor product of two operators onto two variables?

I am trying to make an intuitive Mathemtaica program to show the principle of quantum walking. The idea of quantum walking is very simple and direct, but when I try to transfer it into Mathemitca ...
228 views

### Importing multiple images for machine learning classification

I want to create a ML classifier using images just like this example. I have two classes of images in two different folders. Is there an easier way to import all images from both folders rather than ...
718 views

### An easier way to find the properties of an ellipse from its equation?

In this Q&A about fitting an ellipse to a set of points, there are multiple answers that generated general equations of the ellipse, like this one by @ubpdqn: However, the steps to find out the ...
774 views

### Point style in ListPointPlot3D

In ListPointPlot3D, it seems the only point style available is the default, because there is no PlotMarkers option for this ...
381 views

### Efficient method for Inserting arrays into arrays

This is strongly related to the following Questions: Looking for a way to insert multiple elements into multiple positions simultaneously in a list Building matrices by attaching vectors (columns) ...
134 views

### How to model shocks to parameter in a dynamic system?

My simple model is: m[t_] := m[t] = m[t - 1]*p + 2 m[0] = 0 p = 0.5 I can plot the system as: ...
716 views

### Generate random points in a region with higher probability in a sub-region

I am trying to generate random samples of points in the unit square in such a way that points inside a given circle are twice as likely to be selected as points outside of that circle. I tried to ...
511 views

### How can I draw a hyperboloid given its generatrix?

I want to see how a hyperboloid of revolution is generated by its generatrix, i.e. by rotating one (say the one passing point $(1,0,0)$ and $(0,1,1)$) of the skew lines around another (say the z ...
502 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 ...
191 views

### Pretty InputField

I'm trying to create a "template" notebook for myself. I want to get input from a single InputField, and then run a few operations on it. How can I make the ...
610 views

### Interpolate throughout a 3d data list without extrapolation

I have a 3D list of data for which I'd like to plot an interpolated surface. There are several ways to achieve this, but none I cannot find a method which ONLY plots the ENTIRE interpolated surface ...
444 views

### Slow image manipulation

This is some extremely simple code that shows an image and manipulates a circle (that will be used to select a region of the image to analyze). All those Dynamics ...
500 views

This may be a rather strange question. I will try to create a sort of minimal working example. Suppose that I have two lists, list1 and ...
426 views

I am using MathLink with C/C++ on a Unix system in order to call a Mathematica (version 9) function and get the result. The function I need to call is a personal function of mine ...
589 views

### How to solve this equation with integers as a solution?

I want to solve the equation $$x^y + y = y^x + x$$ with $x$, $y$ are integer numbers. I tried Solve[x^y + y == y^x + x, {x, y}, Integers] How to solve the ...
334 views

### How to force Pane to always scroll to end of content? [duplicate]

Mathematica seems to know about the actual end of content position in a Pane if given large enough (but not too large$^1$) initial position value. Here, the ...
494 views

### Symbolic derivative of $n$-term product

I want to determine the relationship that must exist between the $x_i$ and $y_i$ such that $$\frac{\partial}{\partial\theta} \prod_{i=1}^n \frac{f(x_i,\theta)}{f(y_i,\theta)} = 0,$$ where  ...
### How to obtain a fixed number of solutions to $x+y=1$?
How to obtain a fixed number of solutions to $x+y=1$? For example, I want 4 solutions: $(1,0),(2,-1),(3,-2),(-2,3)$ I want to do this also on bigger equations such as $x+y+...=1$ and then I want to ...