Tagged Questions

Questions on the manipulation of List objects in Mathematica, and the functions used for these manipulations.

448 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 ...
242 views

Strategies to find curves on messy data using FindCurvePath

I have a set of data points that correspond to roots of a transcendental equation with respect to a parameter (the abscissa) which, by the properties of the system, define continuous curves (might be ...
235 views

Solve and design “water flow”

In some strategy game I play, I'll have to change the terrain to make the water flow in some specific way to fulfill my goal. The water flow changes with terrain so if I can change the terrain wisely ...
167 views

Efficient way to flatten or transpose-arrayreshape tensors

I have a tensor of dimensions $(2, 100, 100, 2, 100, 100)$ and I want to reshape it to a form of $(2*100*100,2*100*100)$, e.g. Flatten[A,{{1,5,6},{4,2,3}}]. If I ...
122 views

TimeConstrained[Delete[Range[1],1]] causes kernel crash

Run these two samples of code here (AFTER SAVING YOUR CURRENT WORK): Do[ TimeConstrained[ While[True, Delete[{1}, 1]; ];, 0.1];, {100}] ...
58 views

SimilarityRules for SequenceAlignment of two lists

I am trying to use the SimilarityRules option of SequenceAlignment to customize its output. This works perfectly for strings, ...
68 views

Create an adequate 'training set' to train a ClassifierFunction which performs the role of the built-in SubsetQ

I am trying to "grow" my own SubsetQ function using Machine Learning methods. My cSubsetQ when given two lists (listA and listB)...
112 views

Bug in ListLinePlot[] when Filling up and down?

I'm trying to understand this apparently incorrect Filling behavior in ListLinePlot[]. Evaluating this ...
125 views

Gather dependency on list order?

I get intrigued about Gather behavior on this post. I thought that Gather was invariant under list order? Here is the result I ...
274 views

Strange behavior of undocumented RawArray and ArrayObject expressions

I discovered several strange results and inconsistencies while trying to understand what undocumented RawArray and ArrayObject ...
76 views

Mysterious Riffle::rspec warning

I have part of a code that looks like this: ...
80 views

Kernel crashes when computing finite difference mixed derivative with respect to y & z but works fine when computing with respect to x & y or x & z?

I am using Mathematica 10.4.0 on Ubuntu 16.04. I am trying to solve a set of differential equations using finite difference method on an NxNxN cubic grid (x, y, z directions). I am getting a weird ...
59 views

Weird behaviour for a vector InterpolatingFunction inside an NDSolve

I have run into some weird behaviour on the part of NDSolve which I find pretty bizarre and which I would like to understand better. Suppose, for the sake of ...
474 views

Taking real and imaginary parts of indexed functions and speeding up ComplexExpand

I am setting up a large system of ODEs and in order to use the IDA method (which is sig. faster for my system and thus attractive), I must split my equations into real and imaginary parts. I am ...
35 views

How to create a function similar to MorphologicalComponents?

As everyone knows, MorphologicalComponents can create a list that shows only the difference between morphological clusters. But sometimes we need to find out the ...
76 views

Function output

I would like a function that computes Cartesian product of two sets z=(Tuples@{#1,#2}), and computes the number of elements in this set(list) ...
100 views

Fast construction and reshaping of large tensors

I'm trying to construct a large matrix which is derived from some higher rank tensor (the rank of interest to me changes case by case, so it needs to be a general method). Currently, the process of ...
76 views

Compilation of a function that needs to call Subsets

I'm working on a code that runs many (easy) operations on combinations (subsets) of different size (6, 7, 8, 9) taken from a big set of numbers (normally more that 40). So, this means the code has to ...
75 views

Choosing a List as VertexWeight for a TreeGraph

I would like to map every vertex of my TreeGraph to an List. ...
117 views

ParallelTable and expensive functions

I would like to build up a 2D-Table using ParallelTable as follows ...
282 views

Faster Ways to compute recursive summation

It takes a long time to compute the summation below, and I'd like to know if there are some better ways to compute things faster. I have used $3$ ways to calculate, but they are very unsatisfactory. I ...
77 views

The number of real values assumed by combinations of complex roots of a decic

Define complex conjugate as the pair of complex numbers $a+bi,a-bi$. Assume you have 5 such pairs and they are the 10 roots $x_i$ of a 10th-deg equation with integer coefficients. In general, how many ...
487 views

Generating a function which outputs possible chemical reactions

I want to make a list of chemical reactions and I write them down in a $\require{mhchem}\LaTeX$ format. They are of the following form NA_n^i+MB_m^j \rightarrow \hat NA_{\hat n}^{\hat i}+\hat MA_{\...
26 views

How to list all binary expression trees with given leaves

If i have a list of leaf nodes and nonleaf nodes with specified arities, how can I effieciently enumerate the possible trees? For example: ...
27 views

Make a .C3D file in Mathematica

I have two different groups of points in an excel file, which are captured by two different cameras from two different angles (Motion Capture Process). These points are extracted by using markers on a ...
44 views

Remove columns basing on binary sequence

Possibly it is duplicate, still I could not find here elegant way to remove matrix columns basing on binary sequence. i.e. if I apply {1,1,0,0,1,0,1} to matrix it should delete columns 3,4 and 6.
32 views

Arrange of several files

I am struggling to import my data. There are 400 files in CSV format with names organised by date like: Table1_20111003_YYYY_MM_DD_0000.dat. In each file over 20 colums and 86400 rows (seconds of ...
49 views

List manipulation, averaging over lists and fidelity

I want to create vectors from a function poly[Î±_, Î²_, Î´_, Ï•1_] were several variables (Î±, Î², Î´) are randomly sampled from a unit sphere. Then I want to vary another ...
35 views

Using Coefficient for Conjugate[variables] (Mathematica ignores my assumptions)

I have a sum and I use Coeffcient[] to extract certain terms. For example, I want all term in the following sum that contain ...
51 views

I very often work with Lists of Lists (trend data exported from other programs). Sometimes the start times of the important data ...
62 views

Finding correct combination of functions

I am trying to write code where I have an array $S$ or numbers in any order [5,4,2,1,....] Then I have a specific set of functions that I can write. ...
80 views

Lower memory usage and speed nested loops

I'm trying to make some tracking with Mathematica. ...
50 views

Generate a list of values of a function for each value of the parameters already found

The following question is an extension of this question Find all roots of a function with parabolic cylinder functions in a range of the variable. Now I want to use the roots found to calculate a ...
65 views

Problems with indexes in a Do-cycle and CoefficientArrays

I have a system of linear equations with variables $A_n$ and need its coefficients in a matrix form (Transform linear system into a matrix form). I'm trying to do that through a ...
96 views

Tracking solutions over a Brillouin zone

Thanks to @bbgodfrey I have a function that finds the two solutions to a set of equations bounded by a hexagonal region (corresponding to the Brillouin zone). It takes the angle ...
102 views

Disease Network Model Using NDSolve

I have a basic disease model using NDSolve: ...
45 views

FirstPosition returning an error message together with the correct answer

I have the following code: ...
105 views

Find algorithm or generator formula with automated procedure and pattern recognition

I am trying to find a generator formula for the discriminant of a polynomial and believe it would be an interesting problem for the Mathematica community to know how to automate evaluation of certain ...
141 views

Autocorrelation of 3D Points

I'm trying to compute the autocorrelation of a list of points $(x,y,z)$ in 3D. Can the CorrelationFunction or maybe ListCorrelate...
120 views

How to create a complex variable from dated list values

Can anyone help me to construct a variable "PI" from values of variable x. Variable x represents a group of two time series rj and ri on equal dates(joined two dated lists with states).Variable x have ...
67 views

A more efficient way of fitting a non-linear model that returns an entire list?

I have a function that takes two parameters, del and nu, and returns a list npoints long ...
468 views

Convolve two sets of (x,y) data sets

I have two sets of data in the form a={{.1,2},{.2,3},{.3,4},{.5,6}} b={{0,8},{.1,4},{.2,7},{.3,1},{.5,10},{.6,3}} Both data sets have even spacing, although ...
124 views

New list generated from the sum of elements taken from two lists

I have been using mathematica for a while, but I have problem wrapping my head around list manipulation functions. I would appreciate any suggestions. Here is what I want to do. ListV is a list of ...
105 views

Optimized subset algorithm implementation

I was reading a paper from Mathematica Journal.It mentions a code for calculating subsets. ...
165 views

Why doesn't ParallelMap improve the performance of FoldList?

This question arose during my analysis of the following problem: filling gaps. (The code used here is Simon Woods's work.) FoldList seems to not cooperate with <...
19 views

Partitioning a set with a condition and ability to change it?

I asked this question and there is nice answers but only the first answer permit us to change the condition to another if we want, but this answer use a brute force approach and we can't use a ...
40 views

How to delete sublist in a list?, with DeleteCase or similar

I like to delete the sublist that have the second element "" (or any other you can set as "-1" or "A") In the next example, I would like to erase the first and third sublist. How can I do this with <...
38 views

Sorting Ordered List of Words by First Letter

I am trying to sort an ordered list of the most common Arabic words. I want to create sublists of words according to their first letter while maintaining the order of the original list. Here's an ...