# All Questions

87 views

### Issues with creating functions [duplicate]

Sometimes when I try to create a function inside a function, Mathematica gives me a hard time. I usually just have to play around with the syntax until it gets something it "likes" but I really have ...
273 views

### Mathematica: computing a difficult integral

I am trying to compute the following integral: Integrate[Exp[Sum[-((cw λ - b[i])^2/(2 σ^2)), {i, 1, n}]], {cw, 0, 1}] And currently Mathematica outputs ...
206 views

### Random variates in Recurrence Function

I'm completely new to Mathematica and can't seem to find an answer elsewhere so hopefully I can get some help here. I'm trying to plot a recurrence relation, where a random variate is generated at ...
2k views

### How to place legend labels for Histogram and ListLinePlots correctly?

I would like to place AxesLabels: For x axis at center of the Histogram and LineListPLots. For y axis rotated 90 degree anti clockwise. I don't see any options for it? ...
76 views

### Evaluate open cell segments in a notebook

The Evaluate > EvaluateNotebook evaluates the whole notebook. Is it possible to somehow evaluate ONLY the open sections of a notebook?
176 views

### Is it possible to interact with an external program's command-line interface?

I am performing a calculation in Mathematica which relies on calls to an external program that acts as a black box for calculating a function $f$, and I would like to know if it is possible for ...
5k views

### 3D heatmap density plot

I have a set of data that looks like {{x1, y1, z1}, {x2, y2, z2}, ...} so it describes points in 3D space. I want to make a heatmap out of this data. So that points ...
381 views

### Coloring vertices using GraphPlot

I have the following problem: I used GraphPlot to plot my adjacency matrix. I divided my nodes in three groups: ...
306 views

### Row-Reduced-Echelon-Form with Equation Parameters for Consistent Systems

I often do row-reduced-echelon-form (RREF) calculations that involve parameters using the RowReduce command. Most times, I want to know which parameters make the system consistent. For example: ...
106 views

### Check whether a function of two variables is a probabilty distribution function

I have a function like this $f(x,y)=c\,y\,(y-x),\ \text{for}\ 0<x<2,\;-x<y<x$ and I need to find the value of $c$ such that $f(x,y)$ is a PDF. How can I do that? I know that the ...
157 views

### How to get a list of pairs into the form $(x,y)$?

I want to put the solutions of the equation $y = (x + 3)/(x - 3)$, where $x$, $y$ are integers, into the form $(x,y)$. For example, $(2, -5)$ instead of $\{2,-5\}$. When I evaluated ...
101 views

### Workaround for automatic replacement of “\r” to “\n”

When I run the following code in an empty notebook SetOptions[EvaluationNotebook[], testOption -> "\n\r"] and then open the notebook in Notepad, I find ...
325 views

### find the number of integral solutions a+b+c+d+e+f = 18 [duplicate]

Find the number of integral solutions of a + b + c + d + e + f = 18 where a, b, c, d, e, f are elements of the range ...
143 views

### How to embed graphic-element-specific metadata within a Graphics object?

One of the most crucial requirements for rich, interactive scientific graphics is being able to "annotate" individual graphic elements (e.g. the data points of a scatterplot, the individual curves in ...
298 views

### Find the value of parameter so that the equation has one solution

Let $(E_l) : x^4-4x^3+x^2(5-l^2)+4 x l^2-4l^2 = 0$ be an equation with $l$ as a parameter and $x$ as an unknown and $S_l$ the set containing all the real solutions of $(E_l)$. Then there is a unique ...
226 views

### Plotting problem

I was wondering why I keep receiving the error message "Derivative should be a triple of numbers, or scaled form" from the following code ...
115 views

### PearsonChiSquareTest: set degrees of freedom

How to set degrees of freedom for PearsonChiSquareTest? I have this: ...
227 views

### Merging Vertices of a Graph and adding up the edges weights

I have a Weighted Graph of g which looks like this. ...
11 views

### Part::partd error on one of two similar lists [duplicate]

I have run into a problem that I can't explain. Here is the code: ...
175 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 ...
55 views

### Can I define a “postfix map” operator with comparable precedence behavior to // [duplicate]

I am trying to define a "postfix map" operator (denoted $OP$ for now) that behaves thus: ...
173 views

### How to optimize computing a product?

Problem description Write a function to caculate the formula My solutions Solution 1: ...
159 views

### Expression giving multiple plots of a function, where each plot varies according to the value for a certain parameter

How can I plot multiple plots for M = 10, 20, 50? ...
156 views

Is there a way to draw a quadrangular surface in Mathematica so that it shows the bilinear term (not two triangles)? The quadrangular polygon is given by the expression $$\phi = \sum_i^4 N_i U_i$$ ...
129 views

### Expanding lists with split strings

I've got data of the type: list = {"Class","MW","10 - 11"} which I would like to split into a number of lists based on the number of characters in the second ...
143 views

### How to deal with WebServices error “any is not supported in sequence”?

I am trying to aquire data through Mathematica's WebServices and this example works just fine: ...
159 views

### Adapting CoefficientList (and the related functions) to work with Laurent polynomials

Is there a slick way to make CoefficientList (and the other similar functions, CoefficientRules etc) work for Laurent polynomials (i.e. where negative exponents can occur), if I don't know a priori ...
325 views

### How to define a button inside Manipulate that tells Mathematica to re-evaluate the whole Manipulate code?

I have written a Manipulate code carrying out some very complicated tasks. There is no problem for the first run, but if I click the reset button to reset all ...
38 views

### a basic question about getting the value of a parameter [closed]

i am new with Mathematica. i am trying to write a simple code. for example: phiu = 2 Yfu = (phi_u/(phi_u + 17.18)) but when i run it, it gives me (phi_u/(phi_u ...
79 views

### Evaluate outer function first

I'm new in Mathematica so this is maybe super easy to do, but I can't figure out how. I've got a function plus[a,b] that sums two numbers and I need to implement a ...
289 views

### How to find the roots of an equation which is almost singular everywhere

I'm trying to find the roots of the equation as a variable of k: ...
163 views

### How can I make controls have Button-like behaviour?

The Button control is very easy to understand Button["Press Me", Print["Pressed"]] I press the button, I execute the ...
93 views

### Testing Equality Expression?

Even if in Graph[{1 -> 2}] == Graph[{1 \[DirectedEdge] 2}] the answer is True ; but why MMA doesn't show the result of the ...
164 views

### Looking to create a lesson on sensory perception of sound

I'm looking to show students a lesson on sensory perception, more specifically on masking. I know a little Mathematica but sound processing has evaded me. I would like to create a white noise and ...
164 views

### Different Vertex Styling in a Graph

We can have this Graph: ...
161 views

### FindSelectedFunction for packages - how to make it work?

The Mathematica help menu contains an entry Find Selected Function (Cmd+Shift+F on OSX). If you are working with say Transpose and want to look up its reference ...
103 views

### Input[] inside DynamicModule causing a kernel crash

I have those few lines of code causing a crash and I can't figure out why: ...
162 views

### RandomVariate does not fill range of PDF of distribution

I've declared my own probability distribution as follows dist[a_, b_] := ProbabilityDistribution[Cos[(b x)/2]^2 Sinc[a x]^2, {x, -400, 400}]; When I try to ...
108 views

### Equation Solving: Solution in terms of predefined functions

Is there a way that I can have Mathematica give me the solution of a problem it has solved in terms of functions that I have predefined? The specific problem I'm trying to solve is: ...
313 views

### Recursive formula involving a piecewise function

I am trying to construct a recursion, g[t], where g[t] = a[t] if g[t-1] = 1 ...
679 views

### Fastest way to do vector / matrix multiplication with constant matrix

Suppose we have a fixed n x n matrix, call it $B$. What is fastest way to evaluate $v^t B\;v$ over many different vectors $v$? Since $B$ is a constant matrix, does this allow the number of operations ...
121 views

### Efficiency problem with least square algorithm (Error in both variables)

I was informing myself about the least square algorithms with errors in x and y. I found this post and the top answer wasn't ...
331 views

### Avoiding zero (empty set) solution with NDSolve

I'm trying to use NDSolve for a chemical kinetics equation where the rate of conversion is given by this relationship as typed in Mathematica: ...
1k views

### How can I manipulate the number of decimal places in the frame ticks?

Is there any simple way to increase or decrease the decimal places in the frame ticks. I want to make the y axis ticks of the first two and the second two graphs look similar.
108 views

### MathKernel with -noprompt hangs indefinitely when converting simple TeX expression

If I enter MathKernel -noprompt -run 'ToExpression["1", TeXForm]; Exit[]' the kernel hangs, apparently while running TeX.exe ...
131 views

### How can AbsoluteTimes be split by date faster?

I have data where the date is stored as an AbsoluteTime. Here's a dummy dataset: ...
34 views

### Solving an algebraic equation with one or more constraints? [duplicate]

Just as a simple example, say I wanted to solve Sin[x] == a for x with the constraints -1<=a<=1 and 0 < x < Pi. Is there any way to do this?
78 views

### How to improve the quality of 3D rendering? [duplicate]

I am trying to combine various 3D objects for a composite image. But some of the objects just don't look very good. In the end, I want to have a publication-quality image. For example, here I ...