# All Questions

211 views

### How to highlight the elements in a list that match a pattern?

For example, {{1,2,3},{1,2,3,1,2,3,4,5}}with pattern {1,_,3}is transformed to ...
293 views

### How is LHS = RHS; … ; LHS (nontrivially) different from … ; RHS

I'm trying to understand how Mathematica thinks about the results of Set. Suppose we perform LHS = RHS. I'm focusing on when ...
85 views

### How do I integrate this function?

I am very new to mathematica and also new to this community. I have a problem given below, How to express this in Mathematica? $H=[2,4,10,5,12,34,42,\cdots 12]$ is a vector of size $N$. $h_n$ is the ...
75 views

### How do I get a list of all the variable present in an algebraic expression? [duplicate]

I have an algebraic expression ...
73 views

### Delete permutations of subtables in a table [closed]

I've got a table of tables: $A=\{\{a,b\},\{b,a\},...,\{a,b,c,d,e\},\{e,d,c,a,b\},...\}$. How do I do to remove backward duplicates, or more generally permutations of duplicates in the table? For ...
612 views

### Why does a comma insert a line break in a comment?

I like to include capital letters and punctuation in my comments. But when I put a comma into a Mathematica comment of the (* ... *) type, it usually causes the comment line to break, with a new line ...
95 views

### Fix my code to return a table of values

Here is a “procedural” program that we wrote in my class, implementing the rectangle rule of numerical integration: ...
143 views

### Minimization Nminimize nnum error

I have imported data (mat is the name, 1x100 dimensional vector)and written a likelihood function for normal distribution. ...
39 views

### How to use FindFit to find the parameter in Laplace space(numerically inverting Laplace transforms)

I am trying to find the parameter in Laplace space, and a very simple example is shown below: I have known the solution $y_{laplace}$ in the laplace space is $a/s^2$, and I also have some discrete ...
57 views

### Create a Table depending of two variables [closed]

I tried to create a table depending of two variables as: W= Table[{G[[i]], G[[j]]}, {i, 1, 3}, {j, 1, 3}] I wanted it to look like ...
194 views

### Periodically tiling a function

I have a function which creates a hole of varying radius, depth and would like to tile it in x and y. ...
181 views

### How to calculate time period?

I have the starting and ending dates and times. And I need to calculate the night time in this period (from 10 pm (22) to 6 am (6)). Example: starting date and time is {2015, 1, 4, 3, 10} ending date ...
78 views

### conditional expectation doesn't work with SmoothKernelDistribution

I'm trying to calculate a conditional expectation E[ x | x > a ], where the distribution of x is inferred from a finite ...
120 views

### Comparing elements of a set and deleting elements based on a criterion

I have a function that has two inputs. The first input is a set of 2-element sets, and the second input is a single 2-element set. My function complements each 2-element set with the second ...
75 views

### Block Matrix Multiplication [closed]

I have a = {{-1}, {0}, {0}} b = IdentityMatrix[3] c = {a, b} d = {{7}, {2}, {0}, {0}} and would like to compute e = c.d ...
351 views

### Solving differential equation

I want to solve the following differential equation DSolve[y''[x] == (λ y[x])/Sqrt[-1 + x], y[x],x] But do not know how to actually solve it. Any suggestion?
146 views

...
39 views

### Procedure argument value change [duplicate]

I'm trying to create my own hamiltonian cycle algorithm using Mathematica for school, and I'm stuck on a syntax issue. I get the following error: ...
57 views

### It is possible to calculate a two vector integral

I have this problem: calculate the integral of: -1+Sqrt[2*d+1] with d being a distance of two points in a 60$\times$60 box ...
79 views

### Passing integration constants to self defined function

I would like to evaluate an integral I am taking in cylindrical coordinates, in which the integrand contains a previously defined function. I need to pass the r and phi integrand values to this ...
67 views

### Strange “Collect[…]” behaviour

I have a large expression which I need to simplify by pulling out a load of constant terms. Collecting terms seems to only work when the expression is expanded out, e.g. ...
106 views

### Is there a way to search for Arithmetic Progressions in a list?

If you have a list of integers is there a way of searching that list to see if there is a trend of Ax+B in the list? Not using all of the numbers, just seeing what trends like that are embedded in a ...
237 views

### Limit the number of processors used by ParallelTable?

By default, ParallelTable will use all the processors available in a PC. Is there a way to set a limit to the number of processors used by ...
172 views

### Find value of x such that x! less than or equal to 1000

I am trying to find the maximum value of $x$ such that $x! \leq 1000$. I tried the following: NSolve[Factorial[x] - 1000 == 0, x] but I got this message: ...
88 views

### Solve[..] does not solve the equation? A bug?

I tried to get the values of CosTheta where the expression is zero and store theses in sol. ...
114 views

### Finding the intersection of two graphs [duplicate]

I'm having difficulty with finding the intersecting point of two graphs. Here is what I have done so far: Plot[{8*n^2, 64*n*Log2[n]}, {n, 0, 100}] which produces ...
442 views

### How to switch from List of rules to Association? [duplicate]

Considering we have a list of rules: ...
134 views

### How can I speed up this NM optimization? Most delay seems to be due to long analytic expression

I am struggling with computational speed of a NelderMead optimization. Nevertheless my impression is that I lose lots of speed not only due to the NM optimization itself but rather to for instance ...
204 views

### Numerical 3D Integration in Mathematica [closed]

My question in short is: Is it possible to make numerical 3D integration in mathematica efficiently? Or am I gonna have to move this to C++? I feel this problem is way too trivial to go to C++, so ...
73 views

### Is there a shorthand for Optional with Condition?

I have a recursive function that does some work to an object for a repeatedamount of times. ...
55 views

### Some problems about ListPlot3D, plot 6 faces of a 3D region [duplicate]

I get the data of six faces of a 3D region. ...
366 views

### SystemException[MemoryAllocationFailure] with Memoized function [closed]

Version 10.1 Win7x64 Enterprise. This is more of a report than a question but others may have seen the same / have insights. I have some code (that I can't really post as it's too big) with a large ...
73 views

### ? (Definition) versus ?? (Information)

What is the difference between ? Definition and ?? ...
130 views

### Plot roots of polynomial system of equations in 3 variables

I have the two equations $x^2 + 2y^2 + z^2 = 1$ and $xz -y^2 = 0$ I want to plot the roots in 3D. i.e the coordinates $x,y$ znd $z$
158 views

### Difference between Log and Log10 [closed]

I typed a function : f := Tan[(1/a)*Log[(Sqrt[x^2 + y^2])]] - y/x I assigned values: ...
446 views

### many indefinite integrals do not evaluate in 10.1, looking for the cause

Bug introduced in 10.1 and fixed in 10.2 Many integrals no longer evaluate in V 10.1 when they did in 10.0.2 Here are some 23 integrals as an example, that all produced results in V 10.0.2, but ...
53 views

### Apply a list to a summation expression

I've gotten unexpected (at least to my novice eyes) application of a list of values to a Sum expression where the variable for imax is also used in the expression ...
145 views

### How to change the radius markers and number of concentric circles in a polar plot?

I'm using PolarPlot to plot a function in [0, 1] in a log scale plot, capped at -40 dB, as in the following example: ...
241 views

### How to get the modulus of following complex number

I want to get the modulus of following (1+(x+I*y)/2+(x+I*y)^2/12)/(1-(x+I*y)/2+(x+I*y)^2/12) I use ...
112 views

### How do I map a function onto the result of an expression that already has a pure function as an argument

I admit that I have only a basic understanding of the way Mathematica handles pure functions - enough to be dangerous, unfortunately. I have some data that is in a list of lists of lists. I would ...
113 views

### FullSimplify Produces Result that Includes Hold

Bug fixed in 10.2.0 In the course of developing a solution to Question 79183, I solved the equation ...
65 views

### Define a function of a vector without fully specifying the components of the vector [duplicate]

I have a vector $A=\{1,2,3,4,5,6\}$, and I want to define a function of $A$ as f[A_]:=A.X where $X$ is another vector. I want to define this function without ...
168 views

### Export from ParametricPlot3D to 3D Formats yields distorted surface meshes

as described im my blog post: http://wolfig-techblog.blogspot.de/2015/04/blender-as-shader-for-mathematica.html I tried to export a Klein bottle ParametricPlot3D to one commonly used 3D mesh formats ...
118 views

### Building a 1 page “Scorecard” in mathematica [closed]

I'd like to be able to generate an 11 x 8.5 "scorecard" for various data projects I am working on. Traditionally, I'd import all my data into Excel, put the data into worksheets, and then have a ...
192 views

### ListConvolve Memory Hemorrhage

Bug introduced in 10.0.0 and fixed in 10.2.0. I wrote a routine that convolves an impulse response array with a test array and checks for the RMS difference between that convolution and a data ...
124 views

### AutomaticUnits in WM10

Despite the unit improvement in WM10, I am still a big fan of the AutomaticUnits package, as I find it faster and more elegant to work with. However, it seems to be ...
130 views

### calculating subsets of a matrix (L=40X40)

I need to calculate all $k$-possible subsets$(k:1,L)$ of matrix with size $L$. I am using subset function as following, ...
251 views

### CountryData fails for some tags and properties

The problem has gone, presumably resolved by WRI. See kirma's comment. I'm using Mathematica 10.0.2 for Mac, and for the first time just tried CountryData. ...
### How do I generate all $n\times m$ matrices s.t. $a_{i,j} \in {a … b}$?
Is there a fast and clean way of generating all possible $n\times m$ matrices s.t. $a_{i,j} \in \{a ... b\}$ - much like Range does in $N$? Consider for example that for $n,m = 2$, $a=0$, $b=2$ I ...