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

learn more… | top users | synonyms (4)

-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
101 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
278 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
120 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
54 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 ...
0
votes
1answer
68 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
57 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
30 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
109 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
124 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
203 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
71 views

SplitBy with exponents

I have ...
11
votes
6answers
570 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
197 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
113 views

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

I have a list of coordinates (coord): ...
0
votes
0answers
38 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, ...
2
votes
1answer
61 views

Part specification error with InterpolatingFunction when generating a Markov Modulated Poisson Process

I want to create a Markov Modulated Poisson Process, where the arrival rates created by the states of a ContinuousMarkovProcess are fed into an ...
8
votes
4answers
143 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
135 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
178 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
121 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 ...
0
votes
1answer
50 views

List operation list1 >= list2 should compare elements

I need a compare-operation for two lists of same length (usually > 100000) which does the following: {2,3,5,4,1,8,7} ...
1
vote
1answer
97 views

How can Tally group elements that differ only by a sign together?

I have a list {{1,-2},{2,2},{-1,2},...} and I want to use Tally to count how often a given pattern appears in the list. This works perfectly, but in addition I ...
5
votes
4answers
237 views

Dynamic list in which the sum of the elements is invariant under changes to the elements

2nd Update Here's a snapshot of a graphical user interface I'm thinking. I hope this could be self-explanatory and demonstrate the functionalities I mentioned in the 1st update. Thank you all! ...
0
votes
0answers
40 views

What is the right way to remove head of a number? [duplicate]

I often have a number for which I want to remove its head, e.g. {1}. I know of two ways to remove the head: {1}[[1]] # & @@ {1} Neither of these methods seem ...
3
votes
2answers
127 views

Plot 2d-ItoProcess data in a plane

I am trying to simulate a simple 2d Ito SDE (randomly perturbed Hamiltonian system). Below is the code. ...
3
votes
2answers
64 views

Select elements from list with given head

I would like to select elements from list by specifying their head. E.g. SelectWithHead[{1,2,3.5,x}, Symbol] = {x} SelectWithHead[{1,2,3.5,x}, Real] = {3.5} What ...
0
votes
1answer
50 views

How to loop in a nested Association?

Considering we have an Association: ...
0
votes
2answers
32 views

Multiplying columns of a list of matrices

I have the following list of matrices ...
19
votes
2answers
233 views
0
votes
0answers
45 views

BinLists for list of depth greater than 1

BinLists uses the bin specification assuming an interval that is closed on the left and open on the right (according to the documentation). So ...
3
votes
1answer
60 views

How to combine keys in nested list of rules or associations?

Considering we have a list of rules: ...
-1
votes
1answer
62 views

Beginner Question: Assigning an indexed Variable to a given list

I am pretty new to the game and have a problem, which i am sitting on for hours. 1) I created a random Matrix 5x5 ...
2
votes
0answers
73 views

How do I flip x and y value of a list in mathematica? [closed]

I am very new to mathematica. I have been trying to the following without any success. I have a list like this : data = {{1,2},{3,4},{5,6}}. I want a list ...
1
vote
1answer
75 views

Import csv file which contains columns of different lengths --> How can I delete empty fields?

I have the following problem: I want to import a csv file into Mathematica. I file as a lot of rows and columns, but the column lengths differ for certain rows. 2 columns always belong together, ...
0
votes
1answer
82 views

Trapezoid approximation to definite integral

this question is related to Basic question on defining more rectangles. I now was trying to adapt the code by MarcoB to get the approxiamtion of the integral by trapezoids, and I used the function ...
0
votes
0answers
41 views

Exporting the NDSolve to matlab with the argument

a = Table[Evaluate[y[x] /. sol], {x, 0, 10, 0.01}]; Export["a.mat", a]; works just fine but ...
1
vote
2answers
93 views

Slicing multidimensional table

Say I have a multidimensional list created in the following way grid= Table[{i, j+1, k+2}, {i, 0, 1}, {j, 0, 1}, {k, 0, 1}] grid={{{{0, 1, 2}, {0, 1, 3}}, {{0, 2, 2}, {0, 2, 3}}}, {{{1, ...
10
votes
4answers
385 views

Graphically approximating the area under a curve as a sum of rectangular regions

I am completely new to Mathematica. Basically I was trying to write a code to plot a function and draw the approximate area by rectangles. To be more precise, plot a function ...
2
votes
5answers
120 views

Cut nested lists based in another nested list

I have a list of data with nested lists of different length in the following format: dataLis={{1,2,3,4,5,6,7,5,4},{2,3,1,5},{4,5,6,7,7,8,9}} Now I have ...
5
votes
4answers
188 views

Counting variable from a list of matrices

I have a list of matrices ...
0
votes
1answer
83 views

How do I manage my memory better when using the Map function?

So I'm attempting to write a Mathematica program that prints a range of natural numbers as the sum of four cubes. I wrote the following Mathematica code to try this, but am running into a memory ...
5
votes
3answers
167 views

Select certain items from nested list

I have a list as follows: lis1={{{a1,b1,c1,d1,e1},{a2,b2,c2,d2,e2}}, {{a3,b3,c3,d3,e3},{a4,b4,c4,d4,e4}}} and would like to delete certain elements from it resp. ...
3
votes
2answers
77 views

Manipulation of .csv imported data — no blanks in either of two lists

Above is a .csv file. I am trying to construct two lists of male and female math test scores such that only districts which include info for both male and female students are included i.e. neither ...
1
vote
1answer
77 views

Take sublist with fixed interval

For example: a = Range[20]; a = ArrayReshape[a, {4, 5}] I want to take elements from a with interval = 2 : ...
4
votes
2answers
125 views

Gridding in a Nested Matrix

We have a nested matrix as: nested={{he, {{e, f, g, h}, {s, 0, q, i}, {s, 0, q, j}}}, {ho, {{e, f, g, h}, {0, u, t, i}, {u, t, 0, j}}}} and with the line ...