All Questions

61,700 questions
33 views

The function VertexContract does not work in specific case

I am using the function VertexContract and I am experiencing that it does not work in some specific cases. If I give the graph with EdgeWeights, EdgeLabels and VertexLabels, I cannot contract {2,5} ...
32 views

Putting legends within the frame of the plot at the desired position

dat1krafull = {{1., 2.61594*^-8}, {10., 7.10017*^-9}, {50., 2.1565*^-9}, {75., 1.6567...
37 views

How can I plot the 3D diagram of x[t], x[t] and a parameter ηb as the three axes?

I have ploted a 2D diagram with ParametricPlot for the equations. The codes ...
183 views

Pairwise Scatter Plots with Histograms and Correlations

Has anybody written a function which can scatter plot data with histograms and correlations? Here is an example form MATLAB. This is related but does not print correlations. R has a similar function. ...
106 views

Visualizing only the chain of a protein and color each residue in Mathematica

Is there a way to visualize in cartoon a single chain of a protein using ProteinData and color the residues by its chemical properties e.g. hydrophobicity, acidic and basic ? The issue here is that I'...
65 views

Generating all connected graphs from a set of n-valent vertices?

I would like to have a function generateConnected[list_] that, given a set of vertices with pre-defined valence (number of outgoing edges) generates all possible ...
81 views

How can I plot a growth curve? [on hold]

How would I draw a plo4 of the function $\qquad dN/dt = r\,N(t)$ in Mathematica? $N(t)$ is the number of individuals in the population at time $t$ and $r$ is the growth rate.
50 views

Interpreting the solution for a nonlinear system in a matrix form

I have an issue of how to interpret the solution of the following nonlinear system in a matrix: $F=PX^{-1}AX+wL$ where $w>0$ is a scalar, $F=(F_1,F_2)$, $P=(P_1,P_2)$, and $L=(L_1,L_2)$ are all a ...
98 views

I wanted to make a simple email address validator using StringMatchQ. This was my first attempt: ...
98 views

How do we optimise double Tables?

I have made the following code which I shall explain it in two parts: First Part: ...
20 views

Numbers not multiplied out in the numerical expansion

I have a Mathematica notebook file with some functions that I need to evaluate numerically. However, for some values of certain variables Mathematica does not give me a result as just one number, but ...
31 views

How to filter audio to get best results in correlation?

I am trying to recognise the alphabetical letters by saving some data of records of me and others saying each letter, then comparing a test audio not contained in the data to each letter using the ...
45 views

Mathematica suddenly became extremly slow (Windows 10)

I restarted my computer, and Mathematica became eeeextremly slow. It takes like 5mn to make calculations it used to do in 3seconds. I have seen Suddenly mathematica is very slow when screen is ...
64 views

How to read in and assign values from a txt file?

I have a text file that I would like to import into Mathematica - after searching around the internet, I can't seem to find any pages that explain how to do this: The text file containes these four ...
693 views

How can I get edges to bend to avoid crossing?

I want to generate a layered drawing of the Hoffman–Singlelton graph. As an example of what I want, here is a layered drawing of the Petersen graph: Now if I right click on the output of ...
27 views

Change input filename according to ticker

I want to import a series of files with similar filenames that change according to a "ticker". An example is filenames A1_data.dat, ...
81 views

...
38 views

Gyrating particle transmission through rectangle: NIntegrate or something faster?

I need a function that tells me, what transmission a gyrating particle has through a rectangular aperture if you consider all phase angles. So for a specific guiding center position and gyration ...
90 views

How to find maximum/minimum in ContourPlot?

The ContourPlot of Sin[x^3 + y] - 2 Cos[x y]==0 has a maximum around (-1.8,-2.3), see figure ...
56 views

Create an array whose index are given by a list (not necesseraly regularly spaced)

I would like to create an array f containing n indices. The label of those indices is stored in a liste of length n, let's call it "list". So I would like to have something like : {f[list[]], f[...
50 views

How does one use NSum within NIntegrate properly?

If I use symbolic integration for the following: Sum[Integrate[i + x, {x, 1, 7}], {i, 1, 7}] 336 as one can see it gives the answer as it seems to '...
122 views

Finding the radius of a circle given that it is tangent to both axes and contains (10, 9)

A circle is tangent to both axes in the 1st quadrant of the xy-plane. If the point (10, 9) is on the circle, what is the circle radius?
68 views

Why is an empty plot produced?

I am trying to plot the values of the functions f[x] and der[x], but I am getting an empty plot. I am new to both Mathematica ...
98 views

How to link C++ code through the new compiler in V12?

The Advanced Compilation Topics talk in the WTC 2018 shows that one can easily link C++ code through the new compiler technology. This feature seems very useful as one can easily load existing C++ ...
4 views

Find the shaded part area? [migrated]

Two squares of side 5 and 2 respectively. They are touching each other. Diagonals of the square are joined. find the area of the shaded part?
60 views

Not getting expected answer for double integral [on hold]

When the Mathematica processes the expressions shown below, the result is 0, That is not the correct answer. Please help me understand what the problem is. (0 < x and z < 1) https://1drv.ms/u/s!...
53 views

Need help in understanding what Extract does

Can anyone explain two examples from the Mathematica Documentation Center reference page on Extract? One is: ...
31 views

Splitting large matrix in neural network

I'm trying to make a neural network that takes a 16x100x100 matrix and splits it into each 100x100 part, puts each through a dense layer, and then puts them them together once again to form a 16x10x10 ...
37 views

Error with NSum : it returns NSum::nsnum: Summand (or its derivative) f[n] is not numerical at point n=17

Consider the following example (I had a lot of trouble to find a minimal working example, I think it is compactified enough now). ...
46 views

Calculation of the average of the values of a column in a matrix

I am trying to have a list of values which corresponds to the mean of the values of each column of a matrix. Here I show a quick example (my current matrix has a dimension of 1000 * 1000) If I have ...
32 views

Alternatives for chromatic number in graphs

The function IGChromaticNumber in IGraph works great, so well, that I have been able to check the chromatic number of graphs with max degree 12 with over a thousand vertices in a relatively short ...
27 views

Simplest way to export (and import) definitions?

Consider I have this code : f=2 f[1.5]=6 f=4 What is the simplest way to save the array f defined on those three numbers in a file ? (in my case, I will ...
129 views

Compute unstable integral with high precision

I want to calculate $$\int_{\mathbb{R}^n} e^{-t_1^4-t_2^4- ...-t_n^4-(1-t_1-t_2-...-t_n)^4} \text{d}t_1 \text{d}t_2 ... \text{d}t_n$$ with the highest possible n. I tried with ...
23 views

Is it better to convert numerical integrals into numerical sums?

I sometimes deal with integrals that can't be solved analytically to give a closed-form expression, but that can be converted into infinite sums instead. Is there a general rule about whether ...
46 views

Why doesn't ClearAll[“Global'*”] remove all variables? [on hold]

Consider the following code : In:= a = 2; In:= ClearAll["Global'*"]; In:= a Out= 2 As you see, the variable a hasn't been resetted. Why ? ...
35 views

Stacked Bar Chart with a bar showing the forecasted quantity and the real quantity as the part of this bar

I was looking for a way to make a stacked bar chart, where a bar shows the forecast and the real quantity as the part of the forecast. So, if the forecasted quantity is 10 and the real quantity is 5, ...
725 views

Generate and graph the Recamán Sequence

I was surprised to see that we don't have any posts that mention the Recamán Sequence, so I figured I should post it as a challenge. By definition, $a_0=0$ and $a_n=a_{n-1}-n$ if the r.h.s. is ...
56 views

Parallelization command possible bug

In the following Mathematica compiled program, 3 persons take turns in a fair Russian Roulette Game with 1 bullet in the 6th chamber and we find the probabilities of each person being killed after 1,...
66 views

34 views

Conditions to make unitary a given matrix

Suppose I have some symmetric matrix W = {{c[1, 1], c[1, 2], c[1, 3]}, {c[1, 2], c[2, 2],c[2, 3]}, {c[1, 3], c[2, 3], c[3, 3]}}; where the c's are complex and I ...
463 views

How do I find and plot the intersection of these three surfaces?

I know how to find the region of intersection of these cylinders using integration, but how would I plot that in mathematica? This is what I have ...
88 views
+50

Aligning plot axes of multiple figures results in different size of the FrameTicks

I defined a new FrameTicksStyle, but their size is changed when more than one figure are stacked vertically. However, the size is accepted when figures are stacked ...