4
votes
1answer
133 views

What would be a pattern for a general row of an identity matrix?

I know this is a novice question but I would like a pattern for a list containing zero or more zeros followed by exactly one 1, followed by zero or more zeros. Something like: {0___,1,0___} But ...
8
votes
2answers
436 views

Problem when defining function through NIntegrate and NDSolve and Interpolation - Bug?

More than a single question, I have some doubts about the output of certain functions when defined through the result of other calculations. I am an active user of Mathematica, but maybe I haven't ...
2
votes
1answer
70 views

How to create a numerically “equal” function?

A simple example about what I need to do. For example, I have three functions: t1[x,t] t2[x,t] t3[x,t] and, ...
17
votes
5answers
514 views

Mismatch between numerical and analytic evaluation of an integral

I evaluated the following integral $$\int_0^1 \sqrt{r} \left | \cos \left(\left(k+\frac{1}{2}\right) \pi r\right)\right | dr$$ ...
3
votes
3answers
535 views

ContourPlot - unequal contour spacing

how can i specify the contour spacing or how the color range is distributed amongst the function values? Let's say i plot some function depending on x and y. Function values differ between [0, 1]. I ...
4
votes
3answers
305 views

unlisting a nested list

I have a list like this: list = {{a,{1,2,3}},{b,{1,2,4}},{c,{{1,4,5,5},{6,3,2,1}}}} This is a nested list which each element has a name. I want to export it to ...
11
votes
0answers
132 views

Is Mathematica 10 color managed?

With ColorProfileData[] Mathematica 10 can handle device-dependent color spaces. However, images with embedded color profiles, e.g. sRGB, are rendered and displayed ...
1
vote
3answers
122 views

Removing some data and replacing them with new ones

I have a data list where the elements have the form (time, velocity ). I need to remove some malformed elements in places where the data does not change smoothly and then replace those points by ...
5
votes
1answer
112 views

Strange behaviour of UpSet [duplicate]

Can anyone explain what is going on here? I want to modify TensorRank for IdentityMatrix, but it fails on its first attempt: ...
2
votes
0answers
149 views

Quartic equation [closed]

After using Solve I am choosing the physical root of my equation and dealing further with this root. However, when I am changing parameters using Manipulate, I clearly see not smooth behaviour. Is ...
3
votes
1answer
124 views

Dealing with square roots [duplicate]

Consider following expression: $$ \sqrt{-\left(2 \sqrt{x^{-8/3}-x^{-4/3}+1}\, x^{4/3}+5\right) x^{4/3}+4 \sqrt{x^{-8/3}-x^{-4/3}+1}\, x^{4/3}+2 x^{8/3}+5} $$ In code: ...
3
votes
2answers
326 views

Plot “OilReserves” using CountryData from 1985 until 2014

I am newer using Mathematica to plot with the Function: CountryData, I am trying to plot "OilReserves" in "UnitedKingdom" from 1985 until 2014. I don't know how to do it, please help me!
1
vote
2answers
191 views

Replace a value in a nested array

When I run the following, ...
0
votes
0answers
167 views

Why is Mathematica 10 giving me the junk data from Instagram?

Instagram: instagram = ServiceConnect["Instagram"] ServiceExecute[conn,"request",params] sends a request to the connection identified by conn, in my example ...
2
votes
4answers
141 views

Finding the maximum order derivative of an expression

I have an expression that is the the sum and product of undefined derivatives and their derivatives. e.g. fg+ Dt[f,t]g +Dt[g,{t,2}]f+ What I would like to find ...
4
votes
2answers
142 views

Create composite key - operating across rows in a dataset

I would like to be able to create a new dataset by extracting 2 columns to make a composite key, and also extracting other columns. For example, suppose my dataset looked like: I would like to ...
2
votes
3answers
90 views

Take a list with the amounts of the random samples from another list while holding the index

I have a list called cant with some amounts of samples to take from the list community as follows: ...
-2
votes
1answer
236 views

$SU(4)$ Structure constants in mathematica

How can I write a mathematica function which will output arbitrary structure constants of SU(4)?
9
votes
4answers
1k views

Join two datasets on keys

I want to be able to join two datasets by keys, pretty much like I'd do in SQL. I thought the JoinAcross function might do it, but it doesn't operate the way I thought. The example in the ...
2
votes
1answer
234 views

Plotting in projective space

I am having difficulty figuring out how to plot to projective space. Suppose I have a region which I have plotted such as: ...
3
votes
2answers
104 views

Running “Animate” Using a Button

I made the button below for launching an Animate, but it doesn't work at all! Why? ...
2
votes
0answers
274 views

Maximizing Large Multivariable Function over Region with Parameter Constraints

Brand new Mathematica user here. I have a complicated function to maximize, and thought I would try software like Mathematica instead of taking derivatives by hand. I found some Mathematica ...
2
votes
1answer
574 views

Solve ODE $d^2u/dx^2 + u/A = 0$

How can I solve following ODE with Mathematical: $$d^2u/dx^2 + u/A = 0 \quad (\text{or } \ C),$$ with the conditions: $$ \left.\frac{d^2u}{dx^2}\right|_{x=0} = 0, $$ $$u(x=0) = B$$ and ...
5
votes
6answers
233 views

First pair out of order

I would like to know how to efficiently determine the first pair of elements in a list that are not in order according to some predicate p. That is, list[i] > list[j] according to p, and i is the ...
3
votes
3answers
395 views

Postfix with two arguments

This must be duplicate but can't find any related post. I'm want to pas it two argument in postfix like f[a_,b_]:=a+b; 1,2//f ...
2
votes
0answers
185 views

Copy As PDF in MMA 10

Wondering if this is a known issue.. I usually export graphics and Grids using the Copy As PDF menu item. The results looked quite good in MMA 9 on Yosemite. However in MMA 10 on Yosemite, the PDF ...
12
votes
2answers
737 views

Parsing a CSV file using Interpreter

The new Interpreter functionality in version 10 looks like it has the potential to make parsing custom data formats very easy. I'm trying to create a CSV parser. ...
3
votes
3answers
167 views

Matrix manipulation

Thank you for looking and answering this question. I am trying to create a new matrix from an old one. Meaning, I have a original matrix that's 20x20. I want to keep the first five lines of the ...
1
vote
0answers
160 views

Cross-validation of a FittedModel

Although I would know how to perform cross-validation tests after fitting a model using a function like NonLinearModelFit, I wonder if there is a way to do this providing the right parameters to the ...
6
votes
2answers
110 views

ClassifierInformation's “ClassPriors” misreporting?

To the TLDR people It seems to me that when you explicitly set ClassPriors when running Classify, it creates a ...
1
vote
2answers
131 views

How to define a variable updating function? [duplicate]

I tried to program a Sudoku solver when I suddenly ran into this problem: I need a function which effectivley does this: ...
1
vote
2answers
198 views

Simulation Beta Distribution

Suppose a function such as: $\phi^{\alpha} (x,y) = \left\{ \begin{array}{l l} \alpha x & \quad \text{if $x < y$}\\ x & \quad \text{if $x = y$}\\ \alpha x + (1 -\alpha) & ...
4
votes
8answers
492 views

How to sort my list?

For example I have two lists of such structure L1 = {{"Australia",a1}, {"USA",a2}, {"Norway",a3},...} L2 = {{"Russia",b1}, {"Norway",b2}, {"Japan",b3},...} I ...
1
vote
1answer
191 views

WhenEvent “StopIntegration” problem

The first example on the WhenEvent help page is ...
3
votes
7answers
213 views

List creation/manipulation

I'd like to a create a list from A = {{a}, {b}, {c}} by taking each elements n times in the following form: ...
5
votes
2answers
600 views

Positioning Vertices in a Graph

I made a graph that has a given number at each vertex: I want to place vertex 1 above vertex 2 if value of vertex 1 is larger than of vertex 2. And also, vertices with same value should be located ...
1
vote
2answers
170 views

How to integrate a function which is only known at discrete points

I have an integration to do. I want to integrate. $\int_0^\infty sin^2(2\pi t)f(t)dt$ where $f(t)$ takes values from an array in the form $\{t,f(t)\}$ The time steps in the array is 1.1s. Can you ...
15
votes
2answers
1k views

PlotLegends -> “Expressions” not working when Plot given one function

I don't get a legend when I use the option PlotLegends -> "Expressions" when the first argument to Plot is a single function. It works OK when I give ...
6
votes
1answer
96 views

How to provide data to users in a way similar to Mathematica's curated data

How can one go about implementing a custom data backend usable by Mathematica? For example something like CountryData or ...
8
votes
2answers
492 views

What is a “Region” in Mathematica 10?

"Region" seems to be a very important concept in Mathematica's latest version. Where can one find the more thorough introductory details about the concept of Region ...
2
votes
1answer
158 views

Fix the size of vertices and arrow in graphs

I defined an option to draw nicely the graph. But I have a problem with the different size obtained. For example, the layout of the first graph is what I want to have for all other graphs I will ...
0
votes
2answers
471 views

$RecursionLimit::reclim: Recursion problem

Please, find bellow my original question. Here is all my code: ...
1
vote
1answer
267 views

Potential hill simulation

I attempted to simulate the motion of a particle approaching to a potential hill. The particle should experience a force of -1/r^2, if the equation for the ...
1
vote
2answers
89 views

Generating an Array of Vectors

I'm working a lot with nested lists of $(x,y)$ coordinates (of a FEM-like mesh, but that's not important), like so: ...
1
vote
0answers
254 views

How could I make an Excel-like table?

I am looking to build a simple Excel type of a table with four columns. I have spent some time researching Mathematica documentation, but haven't come across a way to implement that. Here is a ...
1
vote
4answers
190 views

Check if a scalar falls within the range given by sub-arrays of a matrix

I have a rank 3 matrix: r = {{{1, 10}, {19, 71}, {111, 159}}, {{1, 5}, {25, 63}, {118, 132}, {164, 185}}, {{1, 19}, {28, 49}, {157, 203}}}; and each of the ...
0
votes
0answers
182 views

NDSolve with Table and Boundary Conditions

I am trying to implement a 1D model of coupled field equations where I split up space into pieces to get a system of coupled ODEs which I call Eeqns and Ieqns. The problem I can't figure out is how to ...
0
votes
1answer
359 views

Importing Output from Linux mpstat to Calculate Aggregate and Per-CPU Averages, Creating Tables and Graphs

I'm a Mathematica noob, running a trial version for the moment, but have run into the wall trying to handle this in Excel and am looking for other options. While running a benchmark application I'm ...
8
votes
3answers
481 views

Does Mathematica have Month Range and Day range?

It is known that CharacterRange["a", "z"] gives list of characters from a to z. Does Mathematica have something similar for weekdays and months of the year? ...
7
votes
3answers
536 views

Display ALL keys in dataset

I created a dateset (estimates) with 25 keys (my columns), and about a hundred rows. I'd like to be able to list the keys from the dataset. I did this: ...

15 30 50 per page