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

learn more… | top users | synonyms (5)

0
votes
1answer
80 views

Breaking data sets into series for plotting

I have a generated a data set of a function $\alpha(\lambda_2,\varepsilon):\mathbb{R}_+ \times (0,1) \mapsto (0,1)$. I used mathematica to generate a list by varying $\lambda_2$ and $\varepsilon$; ...
3
votes
1answer
152 views

How can I optimize the search between two lists, one that is changing length?

I'm trying to identify unique arrays by comparing two lists, one which is growing in length. The number of elements in the list grows as 2^n^2, where ...
16
votes
16answers
2k views

Generating a list of numbers that are not multiples of 4

I want to write simple code that will list all numbers from $1$ to $n$ that are not multiples of $4$. And in this case I consider that ...
1
vote
2answers
93 views

How to make some mess points to be more smooth?

Background: The question is derive form this post.I have a another thinking about it.Some points in a suface you can give a certain equation but some points you cannot.So I wanna get a method to ...
3
votes
2answers
99 views

How to gather a list whitout no repeat element to nearest a certain number

Background: The question derive from this question.But some criteria is omited by me.So I try to post a new question for this.If my expression is dimness and you have got it,just tell me or edit my ...
5
votes
2answers
149 views

Multiply list of matrices by list of vectors

I have a list of vectors and a list of matrices for each vector, what i need is to multiply each list of matrices to respective vector. ...
3
votes
2answers
102 views

Find the first n pairs in a list whose difference is the nearest to some number

This is my list: list = {2.6135182051634342, -2.6690957180727297, 0.26060239174734157, -0.4182243295792278}; I wanna gather it every two number,which make ...
4
votes
1answer
65 views

Creating a tensor from matrices

I have 3 nxn matrices that I'd like to combine into a nxnx3 tensor. Basically, I want a new nxn matrix where each element is a 3 tuple of the elements of the other 3 matrices at that same position. ...
16
votes
8answers
3k views

extract values from replacement list

Solve returns a list of replacement rules In: Solve[x + y == 3 && x - y == 6, {x, y}] Out: {{x -> 9/2, y -> -(3/2)}} I am only interested in the ...
2
votes
1answer
60 views

Pairing values with their indexes for MapThread

Several operations require you to map over a list of values and to know the index of each value as you process it. To accomplish this, my current somewhat ugly solution uses MapThread: ...
0
votes
0answers
88 views

How to Extract and Rearrange Elements in Doubly-Nested Lists

Hopefully any easy problem for you guys to help me with! I'm currently having an issue with writing some Mathematica code that will extract the each nth element in each array within a matrix, and then ...
1
vote
1answer
68 views
3
votes
3answers
132 views

Selecting all the elements of different length that contain only numbers

If I have a list of lists with different lengths: {{1, 2, 3}, {1}, {1, 2, 3, 4}, {x}, {1, x}, {2}, {2, 3}} How can I extract all the sub-lists with no symbols: ...
2
votes
3answers
103 views
1
vote
1answer
43 views

list missing numbers [closed]

Let m=[1,2,3,4,5,6,7,8,9,10]; be a set and let s=[ 2,4,5,6,8,9]; be a subset of m. How do list all missing numbers in s from m. For example, the missing numbers in s from 1-->10 are 1,3,7,10. So, ...
1
vote
3answers
85 views

Percent Difference between elements from 2 matrices

If i have a 22 by 25 table of values which depend on n and r, and a list of values that depends on r that is a 22 by 1 matrix, how can I find the percent difference between each element, by row in the ...
1
vote
3answers
66 views

Adding numbers to a list

Say you have the following list of 12 elements X={"x", "x", "x", "x", "x", "x", "x", "x", "x", "x", "x", "x"} And I want to turn it into the following sorted ...
0
votes
1answer
22 views

Define nonzero variables Varyx = z_xy from table with dimensions x,y and values z_xy

I'm trying to do the following. I have a table, call it TransTable. To give an example ...
1
vote
1answer
98 views

List Deconvolution

I have some experimental data to analyse. The function $f(t)$ that describes it is however convolved with a gaussian, due to finite resolution of our experiment. $f(t)$ is too complicated to be ...
1
vote
1answer
50 views

How to deal with repeating usage of same attributes

I am producing in my notebookfile many plots with the following example code: ...
14
votes
6answers
823 views

What's the cleanest functional-programming style way to perform this list operation?

I am looking for the correct method for accomplishing the unknown piece in the following code snippet: rolls = Tuples[Range[1, 4], {2}] ...
2
votes
0answers
71 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) ...
3
votes
1answer
46 views

Corresponding list value and index in a list

I have a list and I know the maximum value of that list by using Max[list]. The thing is I want to find out the index number of this list that corresponds to this ...
6
votes
4answers
190 views

Group list elements in sequence

Suppose we have the following list: list1={1,2,4,6,8,9,10,14,15,17,21,22,72,76,80,96,106,116,117} Actually the real list has about 100K elements. What I want to ...
1
vote
1answer
66 views

Adding +2015 to each value of my x-axis [closed]

I want to change all of the values of my x-axis by +2015 The problem is, I evaluated a large expression using incremental values {i,1,85} and plotted that data. The Plot's x-axis is 1 to 85, as ...
3
votes
3answers
113 views

Assigning to multiple variables in a list the values in another list

I have two lists, one contains the variables and the other the corresponding values that the variables should take. ...
1
vote
1answer
47 views

Transform {x,y,…} and {a,b,…} in to {x->a,y->b,..} [closed]

How to merge two list and add -> to it. For instance, I have {x,y,z,...} and {a,b,c,...} ...
1
vote
1answer
59 views
8
votes
3answers
1k views

How can I get a running sum for a list?

I've got following data I'm reading from a file: ...
11
votes
3answers
324 views

Gathering of list

Problem statement The following challenge was recently posted to the J language programming forum by Skip Cave (http://jsoftware.com/pipermail/programming/2016-March/044561.html): "The animal ...
5
votes
3answers
129 views

Lazy form of Tuples/Outer to loop over list of lists

This is less a question and more asking if someone has implemented this already, with more skill. I need to perform the Outer-like generalized outer product of a ...
4
votes
1answer
62 views

How to create overlapped block matrices and simplify the result

This is sort of a duplicate of Creating overlapped block matrices, but the question wasn't fully answered since the OP never returned to clarify. I am using Kuba's answer for FEM, but I have been ...
1
vote
2answers
59 views

How to use Cases to extract sublists [closed]

I have the following values obtained from a table: ...
4
votes
2answers
300 views

How can I define variables that follow a naming pattern?

Let's say I have this enormous list of a million elements, and I want to access this list piecemeal in non-intersecting sublists of length ten. If ...
1
vote
1answer
45 views

DOS-like Wildcard for Filtering List of Files [duplicate]

I have a list of file names that I would wild like to filter based on a DOS like wildcard specification similar to what can be used as the first argument,"forms", of ...
6
votes
1answer
115 views

How to Collect a variable multiplied by a constant?

I'd like to use Collect to get terms that have a variable multiplied by a constant. For example I'd like: ...
6
votes
3answers
967 views

How to plot several functions without jumping? (multiple eigenvalues of a system as functions of 2 parameters)

I've been working on this research problem for months with some success by no global/proper solution to the problem. So I have square, Hermitian matrices of various sizes ($8,20,38$ dimensions) with ...
0
votes
1answer
104 views

Delete only when there are two (or more) 1s

I would like to remove element from a nested list when they have a certain number of elements repeated. For example: {{1,2,3,4},{1,1,2,3},{1,3,4,1},{1,4,2,4}} I ...
4
votes
3answers
129 views

Indexing all elements of permutations $S_n$

I have this Table that gives all elements of $S_n$, I would like to know how to improve efficiency. ...
1
vote
3answers
260 views

How to select elements from a list by condition?

Considering I have a list: F = {f1, f2, f3, f4} I want to perform exponent on the list F = Power[#, 2]& /@ F Now I ...
7
votes
8answers
393 views

Coefficient list of an expression with indices

My apologies if this question has been asked before, but for the first 50 or so questions on coefficientlist, I couldn't find a similar topic. If I've an expression which involves a variable with ...
1
vote
1answer
63 views

Create large system of inequalities by substituting coefficients from intervals

I have given statements for example: $ax + by < c_1$ $cx + by + dz < c_2$ And I want to create larger system of inequations in such a way (suppose variables $x,y,z$ from intervals): I ...
0
votes
4answers
101 views

How to use Select according to a list of criteria to produce a list of subsets of another list obeying those criteria

The code Print[Select[{1, 4, 3, 9}, Mod[#, 3] == 0 &]]; Print[Select[{1, 4, 3, 9}, Mod[#, 3] == 1 &]]; Print[Select[{1, 4, 3, 9}, Mod[#, 3] == 2 &]] ...
4
votes
2answers
193 views

In a list, exclude words that use too many specific letters

Trying to re-rwite for clarity. Referring to my previous lists: I would like to trim a dictionary so that all words that "consume" more than n letters "x" are ...
0
votes
0answers
48 views

Selecting items in a list based on multiple conditions Part 2 [duplicate]

This question has been solved. Thanks for all your help! I encounter another problem, which is related to a previous question. Now, I have data for different days, so that my data now looks like ...
8
votes
4answers
852 views

Tuples with one “joker” digit?

I'd like to create an array of all possible length 11 combinations of 1, 2, and the number 3, BUT with the number 3 only appearing zero or once in each combination. I tried: ...