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

learn more… | top users | synonyms (3)

-1
votes
1answer
146 views

Strange bug involving a list, “Objects of unequal length” [closed]

sortedTally is a list generated from Tally sortedTally[[1]][[1]] is a list If I print: ...
1
vote
3answers
132 views

List of prime powers

I have a list of not necessarily distinct prime powers. For example: {2,3,4,25,2,3}. I want to combine (multiply) the highest prime powers for each prime. In this case 25*3*4 = 300 since 25 is the ...
1
vote
1answer
74 views

Pattern matching list of elements with different heads

I have a function, which I want to accept only a list of kind of elements belonging to a group. The task comes down to finding an elegant pattern suitable for easy to read function prototype. As an ...
0
votes
0answers
38 views

Constructing a function for expanding general $n$ products

I have the following quantum mechanically motivated product: $\langle0\vert(A_1b_1 + A_2b_2 + A_3b_3)(B_1b_1 + B_2b_2 + B_3b_3)(C_1b_1 + C_2b_2 + C_3b_3)$, where $b_i$ is an annihilation operator ...
0
votes
1answer
56 views

How to count column occurrences in a matrix?

I have a matrix of data, and I want to count the number of columns that match, and have some way to organize them by frequency. But I don't want to count the entire column, but consider the matrix ...
12
votes
6answers
812 views

Deleting Lonely Numbers From a List

Suppose I have a list of integers like so: list = {1,2,5,6,8,10,11,12,14,16,17,18,19}; I'd like a function that will take this list and return a new list with ...
2
votes
1answer
88 views

Grouping large dataset across a large range of values

I have a large data set that I would like to group based upon the quantiles of one specific column. My test data set is about 2.1 million rows by 9 columns (the actual data set will be much larger). ...
0
votes
4answers
123 views

Do loop not working as expected

I am trying to get rid of data in a list. Every three elements I want to delete. Example below: ...
0
votes
0answers
24 views

How to generate a list 'without index' (i.e. {i1, i2, i3…} instead of {i[1], i[2], i[3]…}) [duplicate]

What are ways to generate a list of the form (and arbitrary length)? [i1, i2, i3]
0
votes
1answer
75 views

How to identify and remove errors in a list

After some searching, I did not find a solution to the following problem, which in my thinking should have some very easy/efficient solution. I'm looking at a list of images (faces), that I want to ...
7
votes
4answers
478 views

MovingAverage to include the average of the first and last elements in a list

Is there any way to take the average of pairwise elements in a list? Example: Given the list list = {a,b,c} I'd like to generate the list ...
4
votes
3answers
99 views

How to evaluate an expression over a particular list of tuples?

NOTE: This question is very similar to this one but I realized reading at the answers that I made a mistake in the equation AND I was not clear enough about what I need (my apologies): I want to ...
3
votes
3answers
83 views

Identifying locations of entries in an array

If I’ve got a big array displayed in Mathematica, is there a way for me to select a particular location on the screen and have Mathematica tell me “You’ve selected the entry in row 137 and column 92” ...
1
vote
3answers
176 views

Listing elements starting from 0

The first element in a list v in mathematica is denoted by v[[1]] and subsequent ones are then ...
0
votes
1answer
56 views

How to find the starting point of an oscillation (with noise)?

I've got a series of coordinates which start to oscillate from some time (and with noise), like this: ...
0
votes
2answers
45 views

Selecting the maximum value from the results returned by NSolve

I'm trying to select the maximum value from the answers Mathematica 7.0 is getting from a simple basic NSolve algebric equation : ...
1
vote
2answers
90 views

List Operations: how to combine two lists (pattern given)

Two lists (matrixes) are given: a = {{x1, y1}, {x2, y2}, {x3, y3}}; b = {{u1, v1}, {u2, v2}, {u3, v3}}; Expected return: ...
2
votes
1answer
54 views

How to show steps of “For” command

I wrote the command: list = RandomInteger[{0, 10}, {9, 3}]; For[i = 1, i <= m, i++, element=Total[ list[[i]] ] ] How can I make every step visible? If I ...
0
votes
1answer
55 views

Position vs Part [closed]

What's the difference between Part and Position? How can I "move" from the form used by Part to that of Position (and vicerversa?) Thanks!
2
votes
2answers
87 views

How do I partition a matrix?

I have a data file with fields x y z. When I import it to "data", I get a matrix if the form: ...
4
votes
1answer
160 views

Sow only if different from zero

I am trying to collect elements with Reap and Sow, where I am interested only in non-zero elements, that is I am trying something like that ...
1
vote
0answers
70 views

Manipulate - 3 sliders for a list of 3 elements [closed]

I'm trying to create a slider for a list of 3 elements. I know that I can create a 2D slider for a list of 2 elements and it's impossible to create a 3D slider for a list of 3 elements. So, I just ...
3
votes
1answer
60 views

Map with multiple arguments

I have a function f[m,n] and a list of arguments args = {{m1,n1},{m2,n2},{m3,n3},{m4,n4}, ...} that I want to apply to it. I ...
1
vote
1answer
51 views

How to reduce trigonometric expressions under special conditions

For the following problems I used "FullSimplify" and "TrigReduce" but I manage to reduce more ...
2
votes
1answer
52 views

Transformation syntax with shortcuts to a more explicit syntax for an equation

I would like to write the following code line without the signs @#%^&*?! Sequence @@ (XMLNote[#1, m] &) /@ attributes I have made this code but it seems ...
-1
votes
1answer
63 views

Help needed with assignment [closed]

Can I get some help with this: Write a module which as an input receives two matrices, the first matrix transforms in to the same matrix, but in the new matrix occur absolute values of the first, ...
1
vote
3answers
98 views

Use Do to evaluate an expression over two indices $i \ne j$ (over a list of tuples)?

I have an expression of the form: expr1[i_,j_] = Sum[\[Beta][j]*\[Phi][i, j]* C[i] I would like to evaluate this expression over i=1:4, j=1:4 with i!= j. One ...
1
vote
3answers
81 views

ListPlot the results of FindMaximum [closed]

I want to plot a list of the form whose elements are of the form {value, {x -> value_x, y -> value_y}} The list generated by FindMaximum applied on ...
5
votes
3answers
271 views

Generate a list of equations of curves and plot them

I want to plot a series of lines. This is how I did it: ...
2
votes
2answers
118 views

make trace of a matrix listable?

I have a list of 2 by 2 matrices and I want the list of their traces. I have been using Map[Tr,mylistofmatrices] But I wonder if there is a way to make ...
1
vote
0answers
49 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 ...
1
vote
1answer
55 views

When plot a list, how to Manipulate a sequence of defined functions at the same time?

I am trying to plot a sequence of functions, for example{(a+b)^i},{i,1,100}. All the expressions I have stored in the list. Now I want to plot them and see how their value would change if I change ...
2
votes
1answer
50 views

Problem with plotting data (.csv)

I have a problem with plotting the data of a recent experiment. I'm quite new to Mathematica, but searched the documentation and forums without solving my issue. My data is stored in a .csv document, ...
0
votes
0answers
26 views

To make a list from a For Loop [duplicate]

I have been working on a for loop and generating around 2500 integers from that. Now I am interested in calculating the Max or Min of those numbers. How to create the list of those numbers? So that ...
2
votes
1answer
91 views

How can I run a summation numerous times?

I have been working on code for finding the Allan plot of generated white noise, however, I cannot figure out a way to automate it for a different range of numbers. My code is as follows: ...
3
votes
1answer
107 views

Map an Argument to a list of functions

I want to "map" an argument to a list of functions. Here is the concrete Problem. I generate a list "Messungfit" of functions: ...
0
votes
3answers
115 views

How to cross over the corresponding elements of matrices (genetic algorithm) [closed]

I'm working on some genetic algorithm code, and I'm seeking help to select the corresponding elements of a matrix in order to perform crossover on the chromosomes in population of individuals I want ...
11
votes
2answers
189 views

Simple way to concatenate Dataset columns

Consider these two datasets: d1 = Transpose@Dataset[<|"a" -> Range[5]|>]; d2 = Transpose@Dataset[<|"b" -> Range[5, 1, -1]|>]; {d1, d2} What's ...
0
votes
3answers
57 views

Apply every function from a list to an expression

I would like to apply a list of functions to an expression, like ApplyList[{Re, Im}, Exp[I x]] = {Cos[x], Sin[x]} How do I do that?
0
votes
1answer
68 views

SplitBy with exponents

I have ...
11
votes
6answers
562 views

How to find all the positions of max value of a list efficiently?

For Example, list=RandomInteger[{1,100},2000]. Yes,I know Position[list,Max[list]] can do. But it's based on pattern ...
5
votes
4answers
195 views

How to multiply lists of data?

Let two lists of data, say lst1={{x1,y1},{x2,y2},...,{xn,yn}} lst2={{x1,z1},{x2,z2},...,{xn,zn}} I need to construct a third list ...
0
votes
3answers
108 views

How to take dot product of every element in a list?

I have a list of coordinates (coord): ...
0
votes
0answers
35 views

Standalone cdf with precalculated result

I'm wishing you a nice day. I needed some interactive plots so I used Manipulate. My function is function of several parameters, let's call it $f \left( L, \Gamma, ...
8
votes
4answers
140 views

Handy / flexible directory tree operations

Is there any shorter / more handy / more flexible way to get directory tree as a nested Rules/Associations list? I tried to incorporate ...
2
votes
2answers
131 views

Approximation of definite integral by parabolas

This question is related to Trapezoid approximation to definite integral. As promised, I am now asking about how to draw approximation of integrals by parabolas. I tried to modify MarcoB's code, and I ...
6
votes
2answers
175 views

Subsets or Outer?

How do I generate all possible subsets of a list of positive numbers (with at least 1 of them), given that each of these positive numbers subvariates itself on its input value and its multiplicative ...
2
votes
1answer
46 views

how to manipulate indices in a table/vector

Perhaps I'm missing something very basic. Could somebody guide me how to manipulate indices of a list. For example, if I've u = Table[Subscript[u, i], {i, 1, lp + 1}]. I've these u in an expression, ...
3
votes
1answer
117 views

Constructing lists in an efficient way

I have a list of functions and I want to separate them into two lists: a list that contains the functions that have at least one zero and a list that contains the functions that do not have ...