All Questions

67 views

Have the kernel load a user-defined function by default [duplicate]

I wrote a very simple function that I would like to act as if it were one of the default functions that came with Mathematica, so that you don't have to load or import any package before you make use ...
1k views

Plot 3D set (or a domain of three-variable function)

is there any way to plot a "3D set" of points subject to certain rules? For example, my task is to find maximum of some function of three variables which have to meet some conditions. Of course I ...
277 views

How to replace a variable that was assigned a value before

Question How to make the replacement $f[x] \to f[y]$ for an abitrary function $f$ if $x$ was assigned a value before? Example 1 How can I make the replacement $x +1 \to y + 1$ if I have assigned ...
68 views

...
1k views

Combine absolute and relative (scaled) coordinates

I am using Inset to add an Epilog to a plot. The position of the images (in my case: framed numbers) can be specified as an ...
2k views

Using NonlinearModelFit to fit data with errors

Assume we have some data of measurements SeedRandom[9]; data = Table[{i,2*(1 + 5*RandomReal[])*Exp[-0.01*(1 + RandomReal[])*i]}, {i, {0, 100, 200, 400, 700}}]; ...
91 views

How to relate memory usage with occupied positions of SparseArrays?

What is the relation of memory usage of a SparseArray and the number of its occupied positions? Let's say you build a 100.000.000 by 10 element SparseArray. And fill the two position 1/1 and ...
307 views

Filling and Shading an Harmonic Curve

Suppose I have an equation plotted as shown: ...
92 views

Faster way to perform SameQ[Reduce[…], Reduce[…]]

I'm have some expressions that I need to confirm the equality of. SameQ[Reduce[...], Reduce[...]] works like a charm for the more simple expressions, however when ...
145 views

Interpolation and points of non-differentiability

I have some data, which if expressed by some elementary functions, would contain a non-differentiable point. I would like to be able to use something like interpolate to convert the data into a ...
355 views

Optimizing functions taking matrix arguments

I'm looking for general information on how to optimize matrix valued functions, I have the following function I'm looking to maximize (or figure out if this is possible at all). ...
345 views

How to draw a contour diagram in Mathematica?

This answer at Math.SE contains a neat contour diagram created using Mathematica: What Mathematica functions I can use to draw diagrams like this?
476 views

Telling mathematica to output * instead of space for multiplication, so I can copy as plain text

I am trying to get some symbolic expressions in Mathematica which I would like to paste into my C/MATLAB codes. This can be accomplished nicely by selecting the expression and right-clicking to ...
303 views

A simple StringCases problem

Given this text: text1 = " A Vitamin D Deficiency (ICD-9-CM 268.9) (ICD-9-CM 268.9) 09/11/2015 01 "; Yes, the ICD code values are duplicates- possibly but ...
306 views

Performance of Dispatch and lists of Rules

The issue outlined here seems to be no longer present in version 10, if you use a Dispatch table! This because a Dispatch table ...
98 views

Question about usage of Style as Dynamic object

I saw a Dynamic snippet in this answer, which wrote ...
53 views

It is possible to define function dependently to passed argument type or condition this argument fulfills (somewhat like overloading): ...
559 views

Weird vertical line when trying to plot a histogram [duplicate]

I'm trying to plot a histogram of a few data points and overlay a plot on it (it's a fit of a geometric distribution to my data). The weird thing is that a vertical line appears always next to the ...
171 views

How to draw tiles with different height?

I have a random matrix RandomReal[{1, 2}, {20, 20}], whose elements represent the heights of an array of tiles. The cross sections of each tile are square and ...
962 views

Manipulating plot of random iterated function system fractal

I'm generating the Sierpinski Gasket by implementing a chaos game in mathematica. What I'd like to do is create an interactive manipulation with a slider, whereby moving it forward, plots all the ...
140 views

FindRoot runs out of memory in Windows but not on Mac

I am using FindRoot to find solutions to a large, highly oscillatory equation which I generated using other code. When I run ...
131 views

Filtering the elements of an array to split them into two categories

So, I am new to Mathematica, and I am trying to write something that involves taking values from one array and separating them into two different arrays. My code for doing this is: ...
122 views

create function that behaves like continuedFraction [duplicate]

I'm just starting to learn Mathematica and I got stuck at this question. This a noob question but please help. I need to define a function named continuedFraction that takes user input of type list ...
1k views

Why is there no PositionFunction in Mathematica?

Too often I have seen the programs of inexperienced users greatly slowed by using Position in an iterative fashion, when far faster would have been to compute a ...
3k views

How can I detect an ellipse in a photo?

I tried to detect the rim of the following cup as an ellipse. I've tried the solutions given in How to find circular objects in an image? to detect the ellipse, but the detection result was not ...
230 views

How can I use Manipulate[] to click on a Graphics3D output and generate $(x,y)$ outputs on a projection plane parallel to my screen?

Say I have some Graphics3D object that I'm looking at from a top down perspective, e.g.: ...
28 views

How do I automatically “trim” the bounding box for a Graphics3D output? [duplicate]

I noticed that, provided some Graphics3D output scaled with ImageSize, I can get rid of a lot of the empty space around the graphic by right-clicking and then selecting "Trim Bounding Box". Thinking ...
203 views

undisputed FrontEndTokenExecute

Thanks to this great topic, I've found the FrontEndToken that I was looking for: "DeleteGeneratedCells" (well, it is also ...
152 views

How to keep ItemSize effect when export to HTML

Here's the simple code Grid[Table[Item[1,ItemSize->{5,10}],{2},{2}],ItemSize->{5,10},Background->Red] After saving the output cell as .html file, ...
209 views

Speeding up a numerical constrained quadratic optimization

I'm trying to solve a quadratic optimization problem in 35 variables, $\vec{α} = \left< α_1, \ldots, α_{35}\right>$:  \begin{aligned} &\operatorname*{maximize}_\vec{α}&&1.0\cdot ...
1k views

Dynamic graph visualisation using JLink/Java and GraphStream

Visualising the addition of new nodes and edges to a graph to 'watch it grow' is to something Mathematica is not suited to by default. However this type of animation really helps convey the emergence ...
400 views

Unexpected behavior of confidence bands for data presenting two regions with uneven noise

Let's generate some noisy data with uneven noise. ...
201 views

Setting OperatorSubstitution to False has issues with PDF and EPS exports. Are these bugs?

In Plot, I would like to use my own font, eg Inconsolata, for operators such as ×, so I set OperatorSubstitution to ...
244 views

Problems with RootLocusPlot

I am having some trouble to understand how the RootLocusPlot works (options, drawing and etc.) Here is an example ...
326 views

Problem with the Plot of Functions and PlotLegends

For some odd reason the PlotLegends output is not as expected. ...
562 views

Solar System Orbital Parameters [duplicate]

I recently made an n-body simulation and thought it would be interesting to try and model it on the interior of our solar system (Sun to Mars), but I cannot find initial conditions for such an ...
548 views

How to run an external program in parallel with a Mathematica package?

Under Mathematica 8 (Linux x84_64) I was able to run an external program in parallel from a Mathematica package. However this procedure breaks down under Mathematica 9. Within my Mathematica package ...
166 views

Counting a cardinality of a subset satisfying special property

Suppose that we have a set of 9 2-dimensional vectors $c$ by m=3; n=2; c=Tuples[Range[m],n]; We want to define a subset $S$ of vectors in $c$ by the following: ...
105 views

Does resizing plots produce new data? [duplicate]

What I do: ListPlot, Select the plot area, A tooltip says: Double-click to edit, Double-click the line or a point on the line, Take a handle to resize the red ...
540 views

extracting the rows of a matrix satisfying a condition (e.g. all elements negative)

I have a matrix with thousands of rows and want the submatrix comprising the rows of the original matrix that have, e.g. a negative element in column 3. How to do that?
320 views

substitution rules excluding subscripted variables

Suppose I have an expression containing p,Subscript[p,1],Subscript[p,2],etc. I want to ...
122 views

from complex function to a series

How can I express this complex function as a series? Log[ (1 - E^((I Pi (1 - a))/(b - a)) z)/ (1 - E^(-((I Pi (1 - a))/(b - a))) z) ] Where ...
791 views

Evaluating double Integral

While trying to evaluate the integral $\int_{y=0}^{x_2}\int_{x=0}^{min(x_1,y)} n (n - 1) (1 - y)^{(n - 2)}dxdy$ , Mathematica does not seem to yield any results. ...
179 views

Cell brackets on left side?

Is it possible to have the cell brackets on the left? I looked through the options and couldn't find anything, but maybe it's some kind of esoteric style setting or something. The reason I'm looking ...
361 views

Notebook vs. DocumentNotebook; display a Notebook inline, like a DocumentNotebook

If you evaluate a DocumentNotebook[] expression in the front-end, it nicely displays inline, inside of an output cell in the current notebook: For my purposes, ...
159 views

Evaluation in Manipulate [duplicate]

I have an expression assigned to a variable. For example: exp1 = a*x+b Now I would like to plot it using something like this ...
74 views

Combination of CellPrint and PrintTemporary, or DisplayForm for Cells

I'm programmatically generating some formatted output that generates a cell in the form of a Cell[] expression. For instance, the output might be ...
4k views

I want to draw a graph using a weighted Adjacency matrix

I have a weighted adjacency matrix as follows: ...
For any positive integer $n$ which is not specified a priori, I can make $n$-tuple vector $v$ by v = Array[a, 1, n]. Now, given that $n$ is a positive integer which ...