0
votes
2answers
185 views

Replace doesn't replace the denominator [duplicate]

I have the following expression in Mathematica -((E^(2 - 2 Sqrt[(x[1] - x[2])^2]) (x[1] - x[2]))/Sqrt[(x[1] - x[2])^2]) I want to replace anything of the ...
9
votes
4answers
409 views

Why is Poisson Random Deviate Generation so slow?

I am generating Poisson deviates for some numerical work. Mathematica 9.0.1 is very slow in generating these random numbers, as can be seen below. ...
1
vote
2answers
72 views

How to format the outputs of several properties of ComponentMeasurements?

I know someone may have asked similar questions but the solution doesn't work to me. My code is like this: ...
1
vote
1answer
98 views

ListPlot with redundant labels for tick marks

Is it possible to have two sets of labels for the $x$-axis tick marks using ListPlot? For example, could we have tick marks labels: {1,2,3,4,...}, and then right ...
2
votes
4answers
155 views

How to limit the argument to binary type in mathematica function

How do I write a function that only takes binary input?
4
votes
1answer
215 views

How to reverse the gradient and ticks in BarLegend

I created a plot with a horizontal BarLegend for TemperatureColors (see1). Code: ...
3
votes
1answer
132 views

Changing equations to be solved by NDSolve when an event is triggered

I am using NDSolve to solve a set of coupled differential equations. When a certain event occurs, I want two equations in the set to be changed radically, for example from ...
1
vote
1answer
423 views

Cubic Splines Functions

I have this set of three data points and want the natural cubic spline functions for them: dat = {{-.0247500, .5}, {.3349375, -.25}, {1.101000, 0}}; I tried: ...
0
votes
0answers
27 views

Eliminate some value from a matrix [duplicate]

I have a function that return a table consisting of a 2D points. These points are either {x,y} or {0,0} ...
2
votes
1answer
258 views

add a scale bar to a microscopy image?

Is there any way to add scale bar to a image for example. I just need to add a bar and a text on top of it to all my images without having to rewrite ...
0
votes
1answer
104 views

change font size and circle the pointers

MWE ...
6
votes
2answers
194 views

Implement planar correction for skewed 3D profilometric data

I have some data that represents small-scale surface topography. The data is planar but not flat because it's impractical to level this microscope to a tolerance of microns. It looks like this: I'd ...
5
votes
1answer
211 views

measure minimum distance of dots from edge

I want to measure minimal distance of small dots from the edge of an image: Image of bright dots: Edge image ImageAdd looks like following:
1
vote
2answers
163 views

Does mathematica 9 on mac depend on these dynamic libraries?

The Mac package installing program "brew" suggests I remove some of these dynamic libraries, but I am worried that mathematica 9 might depend on them. As far as mathematica 9 is concerned, is it OK to ...
2
votes
4answers
144 views

Looking for mismatches between two lists

I'm able to do what I need, but it seems like there's always a better way. I have two lists, epiExcel and epiDB. Each has 3 columns and about 2,500 rows. I need to find out if the first 2 columns ...
1
vote
1answer
133 views

Replacement variable in list plot

I would like the replacement: /. {ComplexInfinity -> 0} to be treated as a variable. I am trying to overlay the following list plots: ...
1
vote
1answer
235 views

Gram Schmidt inner and outer products

I know the Gram-Schmidt orthogonalization generates an orthonormal basis from an arbitrary basis. I need help with: Write a program that inputs a list $\{b_1,\dotsc,b_n\}$ of linearly independent ...
2
votes
0answers
125 views

Series expansion: Taylor series takes huge amount of time

I'm working on a notebook, trying to expand the root of a cubic polynomial in Taylor series. When I type: ...
8
votes
2answers
2k views

Speeding up Import and Export in CSV format

I am handling large numerical data in Mathematica. In smaller problems everything worked fine using Export and Import with the ...
15
votes
1answer
195 views

Is there a way to make the “Details” section of the documentation expand by default?

By default, the Mathematica documentation opens with the "Details" section collapsed. This is never what I'm looking for — in fact, I've lost count of the times I've sought help on a feature and ...
3
votes
6answers
258 views

Collecting terms of even exponents

Say I've got a polynomial of $4$ or $5$ variables (we'll say $d_1$, $d_2$, $d_3$, and $d_4$). How would you collect the terms where each $d$ is raised to an even power? It collects the terms of the ...
-2
votes
1answer
180 views

How can I combine two plots that were created in different notebooks?

I have two different programs for simulating a system. when I get the results I have plotting result for each. now I want to combine both drawings so that I compare between them. I want to put both of ...
4
votes
1answer
192 views

Numerical errors/inaccuracies in ProductLog

Context In cosmology, a fairly accurate model to describe the gravitational potential, $\psi(r)$ of dark matter halos is given by $\psi( r)=\log(1+r)/r$. ...
8
votes
2answers
334 views

Is there a way to symbolically invert a piecewise function

I have a piecewise function that is continuous and strictly monotonic, like this: f[t_] = Piecewise[{{t/4, t < 0}, {t/2, t < 3}, {3/2 + (t - 3)*3, True}}] ...
0
votes
0answers
38 views

No output when a parameter changes

I am very new in Mathematica, but I cannot find out what is happening here, looking on the internet. I modified a previous notebook as follows: ...
0
votes
1answer
153 views

Plot[ D[Sin[x]] ] and Evaluate[] [duplicate]

Why does t = 2 Pi; Plot[D[Sin[x],x], {x,0,t}] (* Plotting the derivative of Sin[x] *) not work, but ...
6
votes
3answers
341 views

Fill circle layers with colors according to read values from a plotted curve

I want to read (temperature) values from plotted (cooling) curves and visualize them in layered circles. I have an example made manually for clarification: 3 plotted curves, at certain time steps ...
0
votes
1answer
92 views

Combining an imported PDB file with a set of Graphics3D objects

Imagine we import a PDB file like so (using the example from ref/format/PDB in the help directory): ...
9
votes
1answer
130 views

How to get control over DepthFirstScan?

Is there a way to conditionally take control the flow during a depth-first scan against a TreeGraph? I have a tree graph whose nodes are constructed as object, and there's a method ...
7
votes
1answer
134 views

Problem with exporting nested Rows/Columns to HTML

I will show the problem on the following MWE: Export["test.html", Column[{ Row[{"test", "1"}] }], "HTML", "CSS" -> None] ...
1
vote
2answers
331 views

How can I increase the number of polygons / resolution for this plot?

I have generated the following plot: Code: RegionPlot3D[ x^2 + z^2 < 1 && x^2 + y^2 < 1, {x, -2, 2}, {y, -2, 2}, {z, -2, 2}, Axes -> False] ...
4
votes
1answer
146 views

Confusing font information from CurrentValue

I'm trying to programmatically get the width of a character in Mathematica's default fixed-width font, Courier. I believe CurrentValue holds the answer but I'm ...
1
vote
1answer
147 views

How to apply a tensor to a list of arguments

The problem I have is the following: Let C be a list of coordinates, say, C = {x1, x2, ..., xn} and ...
11
votes
2answers
209 views

Boundary effect of Graphics3D object Tube[]

I draw a Graphics3D object of two tubes: Graphics3D[{Tube[{{-0.2, -1, 0}, {-0.2, 1, 0}}, 0.05], Tube[{{0, 0, -1}, {0, 0, 1}}, 0.05]}, Boxed -> False] And ...
5
votes
2answers
375 views

Selecting morphological components by clicking on them?

This is a bit of a follow-up to a previous question: How can I merge multiple sets of morphological components (perhaps selected using different metrics)? I've run into a few problems recently where ...
18
votes
1answer
448 views

Incorrect result from Integrate

I attempted to calculate the following integral: ...
6
votes
2answers
219 views

Composition of functions using slots

Apolgies if this has been asked and answered, but I'm not even sure what to search for. I have two functions defined as follows: ...
6
votes
2answers
233 views

How to implement a formal expectation operator over an unknown distribution?

I need to do some simplification of an expression involving averages over a stochastic variable (in order to verify a long analytical calculation). The easiest way to do that, I figured, were if I ...
2
votes
2answers
116 views

How to extract data depending on Position of First zero?

I have a file (attached as an image) which I imported to Mathematica and only extracted the first and second column. My problem is that I want to extract the data beginning from the row where $A=0$. ...
0
votes
1answer
124 views

Problem evaluating results of DSolve (Power::infy)

So, after browsing through older posts to see if anybody else could have had the same problem, I have come to the conclusion that I am stuck. That bothers me, especially because it should be straight ...
5
votes
1answer
197 views

How to use Compile to efficiently apply a function to every element of a list

Let's say I have a list of random numbers; list = Table[Random[], {100000}]; I want to apply a function f in every element of ...
0
votes
1answer
96 views

How to combine DSolve and FindRoot

As my differential function is relatively complex I do not want to do the detour of finding an explicit solution via DSolve for it but rather use an FindRoot-like approach by guessing initial starting ...
3
votes
1answer
171 views

The UnitStep function and Intervals

For the input UnitStep[Interval[{-4, 5}]] I get Interval[{0, 1}] Why is this not ...
3
votes
1answer
115 views

Adapting old Arrow expressions

I have an old notebook that uses the now obsolete Arrow package. For example, I have an expression containing ...
1
vote
1answer
43 views

Function that puts zero after a certain decimal in every element of the matrix

We know that in Mathematica there is some default precision, which you can also change. This means, that after a certain decimal(fixed by the precision), the computer puts pseudo random numbers. I am ...
8
votes
2answers
344 views

Goto and Compile

...
1
vote
0answers
53 views

Comparing large numbers [duplicate]

How can I compare really large numbers in Mathematica? I'm trying to compare: 2^4^4^4 < 4^4^4^4 It yields: ...
-2
votes
1answer
482 views

Plotting a graph

Could anyone help me with plotting the following graph? Integrate (-Inf, Inf) (exp(-i*x*t))/((4*pi)((x-1)^2 +25)(exp(-100x) +1)) It's not a code obviously, but I ...
-5
votes
1answer
87 views

Converting function into differential version

I am looking through a journal and I came across a function that I wanted to convert to its differential version using Mathematica. Would anyone be able to get the differential version by using ...
5
votes
1answer
114 views

Apparently contradictory output from Series and D

I defined a function as: g[b_] := Integrate[f[n]Exp[-b DA (n.u)^2], n] Obviously D[g[b], b] /. b -> 0 gives ...

15 30 50 per page