All Questions

3
votes
2answers
358 views

Is there a function for nearest power of 2 in Mathematica like nextpow2 in MATLAB?

I am looking for something like nextpow2 in MATLAB like this: P = nextpow2(A) returns the exponents for the smallest powers of two that satisfy $2^P \geq\left|A\right|$.
1
vote
1answer
133 views

Check for holomorphy of a function

Given a (rather complicated) function H(z), what is the best approach to check symbolically whether it is holomorphic? What I tried is checking explicitly the ...
6
votes
2answers
132 views

Intersection of lists of disjoint intervals

Here is my problem: I have two very large lists of intervals (stored as many couples in the form {{"start point", "end point"}, ..., {"start point", "end point"}), ...
2
votes
1answer
119 views

FindDistributionParameters of a sum of a mixture distribution

I have this Mixture Distribution of two Normal Distributions: ...
1
vote
0answers
29 views

Is equation numbering in exported HTML considered deprecated for built in stylesheets?

So I've been tinkering around with the built in stylesheets and the Export command and I've noticed that in principle equation numbering should work. When you look ...
0
votes
0answers
43 views

Needs entry point of a package from a Mathematica script

I am writing a bunch of Mathematica scripts to run command line in a HPC environment. I am organising my solution in small chunks I can test separately. So I have a directory structure like: ...
0
votes
2answers
107 views

Solving an Equation (Recursively)

I have the following Values: $a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=\frac{g_2}{20};a[5]=0$. I need to compute the value of $b[n]$ in the following equation $$a[n]=\sum _{m=0}^{n} (m-2) \;\;a[m] ...
3
votes
4answers
180 views

Controlling the placement of the y-axis

I use ListPlot for showing the results of my numeric computation. I make my own ticks, so I never know before hand where the vertical center of my plot will be. ...
2
votes
1answer
70 views

Changing Wolfram command line output into copyable text

I generated a long polynomial using the Wolfram command line, with divisions and exponents. But the divisions look like this: 4 - 5 And the exponents are on a ...
1
vote
0answers
116 views

Developing easy code to apply Delta Method to generate prediction bands for custom distributions

I think that this is an interesting issue for all those who when to not only adjust one prediction function, but also to obtain the prediction bands to asses the graphical or tabular error I'm trying ...
5
votes
2answers
169 views

Piecewise Polynomial Interpolation

Given some data pairs $(x_i,y_i)$, with $i=0,...,m$, and a degree $r$, I wish to build a piecewise polynomial function to interpolate these data. That interpolation should be continuous, and, on every ...
1
vote
2answers
93 views

ColorFuntion input

Is there any input for ColorFunction, which ranges from Black for smallest values, goes through red-orange-yellow and ends in very bright yellow almost white for ...
1
vote
1answer
94 views

How do I solve for the real and complex parts of an equation simultaneously?

If I were to have an equation, say something similar to... (1-Sqrt[x - I y])/(1+Sqrt[x - I y]) = A + I B Where I = Sqrt[-1], is there a way for Mathematica to ...
3
votes
1answer
151 views

why Level does not sort output according to their levels

Consider this example: Level[a + f[x, y^n], {0, Infinity}] (*{a, x, y, n, y^n, f[x, y^n], a + f[x, y^n]}*) Why the output is sorted in this way. why not ...
0
votes
1answer
79 views

Inclusion-Exclusion Principle Implementation

I would like to know how I can write a Mathematica code for the Inclusion–exclusion principle. The formulas governing it are: $ P(\bigcup_{i=1}^n A_i)=\sum_{k=1}^n (-1)^{k-1} ...
6
votes
1answer
119 views

Key->Value or Value when returning (multiple) parts of an Association

There seems to be an idiom whereby multiple parts generates Key->Value forms whereas for single part specifications, only a Value is returned. This however, can lead to inconsistencies as follows: ...
3
votes
2answers
213 views

Using ReplaceAll to replace a head

Why would this work to replace the head b with newHead: ...
8
votes
0answers
224 views

Learning Resources for Data Science in the Wolfram Language

I'm delivering an upcoming course on Data Science with the programming/analysis done predominantly in the Wolfram Language. I created the following table to leverage students' familiarity with Lists ...
0
votes
1answer
58 views

Why can NSolve only solve this system of equations after trivial substitution?

The first system immediately yields {}, but the second, equivalent, system yields the solution {{k -> 4.96048, tl1 -> 1.64842, tl2 -> 2.07466}} : ...
0
votes
0answers
30 views

What is that Root[…] inside the answer represent? [duplicate]

So I am encountering this situation, in which mathematica doesn't give me the answer, but in a form of "Root". How do I interpret this ? what is the number after the "&" represent? How should I ...
3
votes
0answers
136 views

Undirected Network and its Monte Carlo Simulation

So I have this array of points, in the form {x, {y,z}}, where x is the node number assigned when I used the locator pane to make a network, and y and z are its unitary coordinates. The graph is made ...
3
votes
1answer
116 views

Interpolation function rejected by ParametricPlot3D

I was playing around with the bouncing ball example, and decided to make a 3d version. I decided to use ParametricPlot3D for a simple independent 3D ...
2
votes
0answers
75 views

How to handle infeasible points in FindRoot?

I am calling FindRoot[f[x,y],{{x,xInit,xMin,xMax},{y,yInit,yMin,yMax}}] where for some points {x,y}, ...
7
votes
2answers
152 views

Probablity weighted ReplaceAll

I'm looking for an elegant way of doing a probability weighted replacement rule, something like this ...
5
votes
2answers
278 views
1
vote
1answer
83 views

why head Association cannot be replaced by head List [duplicate]

Consider replacing head of List by head Association: {a -> x, b -> y, c -> z} /. List -> Association (*<|a -> x, b -> y, c -> z|>*) ...
2
votes
1answer
87 views

Operator-Input Form for Lists?

The documentation on Operator-Input Forms shows the following example which suggests that there is an alternative, convenient, operator-style, tidy technique for inputting lists. However, there is ...
5
votes
3answers
224 views

Can NDSolve handle discountinuos data?

It is possible to numerically solve a differential equation if not-smooth data are involved? For example the following instruction return the error NDSolve::bvdisc: ...
9
votes
2answers
151 views

Backslash commands in strings?

I discovered by playing around that Text[DisplayForm@SubscriptBox["\[Lambda]", "k"]] produces the same result as ...
5
votes
1answer
150 views

Is there a faster way to Map an Association?

Consider mapping an existing Association in a manner such as this: ...
1
vote
1answer
37 views

Automatic substitution of fractions

I have several equations with many variables, and here and there I would like to do a variable substitution. For example, in the equation: a (b + 42 c / d) I ...
7
votes
2answers
143 views

Which function definition is used to evaluate an expression that matches the lefthand side of more than one definition?

In a case like this: f[a_] := a; f[{a_, b_}] := a; I'm wondering whether I should expect f[{2, 3}] to return ...
10
votes
2answers
263 views

Testing Credit Usage in Wolfram Programming Cloud

I currently have a free WPC account, which I am using for testing purposes. Amongst other things, I want to find out more about how the credit system works, in particular how many credits are used, ...
2
votes
0answers
38 views

Unique CellID in-between notebooks

Documentation says that CellID is guaranteed to be unique for a given notebook. I've noticed that CellID are fairly high numbers and although probabilistically speaking the odds of coincidence are ...
2
votes
1answer
87 views

Black line after ImageTrim

as shown in Image correlation I would like to detect the shift between a stack of images. Here are the images: and here the code: ...
2
votes
2answers
154 views

How do I exclude the vertical line plotted at a discontinuity?

Condsider function = Tan[1 x] + Tan[2 x] Plot[function, {x, 0, 1.5}] It has a strong discontinuity around 0.8. The problem is , if I want to find ...
3
votes
1answer
100 views

How do I plot a U- form cylinder

I'm really new to Mathematica, trying to learn some things, but I need help trying to plot this kind of cylinder, a U tube like cylinder. Tried to use an example code like this, and then vary some ...
-2
votes
1answer
41 views

Specifying parameters for the Ticks option [closed]

I'm trying to use Ticks option with ListLinePlot to put ticks at 1, 2, 3, 4, 5, 6, and 7 on the x-axis the points and at 1, 2, ...
8
votes
1answer
101 views

How to get a list of all expressions in a notebook matching a certain pattern?

Suppose I have a Mathematica notebook saved to a certain location on disk. Given a pattern I need to get the list of all expressions matching this pattern that appear in input, output or print cells ...
0
votes
0answers
120 views

Improving the speed of evaluating Table with nested functions

I am a Mathematica novice working with a stack of 1024 x 1024 WatershedComponents (or MorphologicalComponents) label matrices ...
2
votes
2answers
79 views

Inconsistency of output format in `Eigenvalue`

I am bothered by the output format of the last two elements of efre. Is there a way to make these two look like the same format as the first two in ...
6
votes
3answers
225 views

A Case of DeleteCases for WeatherData

I am trying to use ListVectorPlot in combination with WeatherData and CountryData to show ...
5
votes
5answers
173 views

Providing a color function for ListPointPlot3D

Is there a way to write ListPointPlot3D expression, so when given a list of points, the the color of the points plotted is a function of the index/element number of ...
2
votes
1answer
199 views

Converting a nested for loop from MATLAB

In MATLAB I have the following series of nested for loops that update a matrix. (It's not my code, but someone else's that I'm trying to replicate - I don't know ...
3
votes
0answers
71 views

Using Mathematica to help obtain correct analytic formula for logarithm integration

I need to program into my Mathematica code the analytic form for the result of the integral: $$I(a,b)=\int ^1 _0 dx \frac{\ln(x-a)}{x-b}$$ that is valid for all complex $a$ and $b$ (but $\text{Im } ...
10
votes
2answers
226 views

Deploying to the Cloud for Public Access

Note: Fixed sometime around the 18th of August 2014. Bug present from the release of 10.0.0. until then. I wanted to test how a simple deployed program would appear to a non-mathematica user. I ...
1
vote
1answer
55 views

Conditions in SparseArray

I got confused by {i_, j_} /; in the following code. I didn't see an explanation in the SparseArray documentation. Can anyone ...
3
votes
1answer
110 views

Calculate geo location based on distance from other locations

Given a list of entities (or GeoPositions) and their distances from a particular location, how do I find that location's ...
8
votes
4answers
311 views

Fast method to select matrix elements based on a vector of positions

There is an operation for which I have long wanted to find a better solution. Let: a be a matrix of dimensions $m\times n$ ...
1
vote
2answers
93 views

eccentric anomaly expansion equation

I try to use this simple algorithm (paper) to calculate the Eccentric Anomaly expansion: ...

15 30 50 per page