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

learn more… | top users | synonyms (3)

0
votes
1answer
16 views

Replace element of matrix based on rule which invloves other element of same matrix

I am trying to replace 1s row of matrix d iteratively from right by multiplying last element in 1st row with (1-int*dt) to generate 2nd last element. The replacement continues till I reach the 1st ...
1
vote
2answers
84 views

How can I reshape my solutions to make a 3D plot?

I need some help on the following. I need to run Solve for multiple values of a and b. To do so instead of using Do, I use ...
0
votes
1answer
26 views

Replace parts of nested lists

I have list of stock data as follows: lis1= {{{1992/10/12, 126.946, ^AEX}, {1992/10/13, 127.85,^AEX}}, {{1992/10/12, 88.487, ^AFLI},{1992/10/13, 91.825,^AFLI}}} ...
0
votes
0answers
42 views

How to replace a part of array based on certain rules which involves usage of other array

I am trying to replace outermost column of array "fd" in below code. fd is matrix of dimension (nas1,nts) which is initially filled with 1. I want to replace outermost column of fd with result of Max ...
6
votes
3answers
215 views

List and patterns

Given some tuple $\{N,M,L\}$ such that $N\geq M\geq L\geq 0$ and $N>0$, how can I generate all tuples $\{n,m,l\}$ such that $n\geq m\geq l\geq 0$ and such that ...
1
vote
2answers
33 views
1
vote
3answers
81 views

2D Interpolation of data file

I hae a datafile with 5 columns of the structure: x_i f(x_i,y_1) f(x_i,y_2) f(x_i,y_3) f(x_i,y_3) f(x_i,y_4) with i = 1 to about 100. Thus there are about ...
0
votes
0answers
21 views

NCAlgebra to calculate a Hermitian conjugate

I have to calculate a non-commutative product of this form: $(-H a+ J a b)**(-H a + K c)$ where $H,J,K$ are variables and $a,b,c$ are operators that don't commute. For this purpose I used the package ...
4
votes
1answer
85 views

Better method to swap the values of two 2-D arrays

I have two 2-D matrices $A$ and $B$(owns same dimentions) which have the style written as below: $ \begin{bmatrix} a_{11} & a_{12} & \cdots & a_{1k} &\cdots &\cdots & ...
2
votes
3answers
79 views

Shorthand to write repetitive test in mathematica

I have the following set of Mathematica statements: ...
1
vote
3answers
76 views

Finding roots of transcendental equation and collecting into a list

I am working on a physics reserach project for school and I have run into some troubles working Mathematica. I am a fairly inexperienced mathematica user so any help would very much be appreciated. I ...
2
votes
3answers
58 views

Flattening of Matrix rows [duplicate]

It's got to be easy, but I can't come up with a general solution. m = {{16, 2, 3, 13}, {{5, 11, 10, 8}, {9, 7, 6, 12}}, {4, 14, 15, 1}}; What I'm trying to ...
0
votes
1answer
39 views

How to switch keys in a Map to Association [on hold]

I have an association that has parameters for a function. These parameters represent two cases that need to be applied to the function. Some parameter values are common to both cases but some are ...
0
votes
0answers
29 views

How to generate the list of consecutive pairs from a list? [duplicate]

What is the morally right solution to mapping a list {a,b,c,...} to the list of pairs {{a,b},{b,c},{c,..},..}? The solution I came up with feels a little clumsy: Shift a copied list by one and form ...
-1
votes
1answer
45 views

Manipulate excel file and plot

I have a number of .csv files that have the following format: I want to do the following: ignore the last two rows sort all the remaining rows w.r.t the 2nd ...
3
votes
2answers
61 views

How to re-arrange lists, divide one list into 2 lists with a particular step [duplicate]

How to re-arrange following list: {a1,b1,a2,b2,a3,b3,a4,b4} or this {a1,b1},{a2,b2},{a3,b3},{a4,b4} to get: ...
8
votes
1answer
118 views

Faster trimming of leading/trailing zeroes in rectangular array

Given a (large) rectangular array, e.g. (small for example case): ...
1
vote
1answer
46 views

Collecting specific Lists of data in coordinate form

Note: This might be trivial for many of the users but i am new to mathematica so i don't know!!! Question: Suppose i have three list of data as follows: ...
0
votes
0answers
24 views

ListContourPlot for 3D data [closed]

I have an n x 3 list of some solar cell data that looks like this. ...
13
votes
6answers
667 views

Finding the period of an array of integers

A simple array of integers is given. The problem is to detect if a pattern is repeatedly occurring in the array, and find the length of that pattern. For example, for ...
1
vote
2answers
47 views

Perform operation on part of a table / create a reference

There is a function f that I would like to operate on a rectangular part of a table t. The part is specified by function ...
0
votes
0answers
23 views

Generating a list consisting of function values like in a triangular matrix

A goal is to generate a SymmetrizedArray of dimension n^k with specified symmetry (let it to be ...
1
vote
4answers
160 views
2
votes
2answers
158 views

Are there any good mass row/column swapping functions for matrices?

I have the following matrix Keeping the 20 row and 20 column fixed (so the 21st rows and columns because I started at 0)...how do I push each row and column back one spot? I need to push the 0th row ...
4
votes
6answers
215 views

Indexed Map Thread

I'm attempting to MapThread a function of two lists that requires the index of the list values. For example, MapThread[#1*i+#2*j&,{{a,b,c},{e,f,g}}] Where #1 ...
2
votes
1answer
52 views

Simplify on a structured array

Why doesn't Simplify and FullSimplify operate on object generated using SymmetrizedArray? ...
0
votes
0answers
30 views

Copying an Imported List to another File

I have a file which begins with a large list of elements created by joining 12 different data imports, which I would now like to copy to another file so that the file can be sent by itself and not ...
1
vote
3answers
124 views

How to do a Check for every element in the list?

I know how to do a Check for the list in general: ...
1
vote
5answers
134 views

How to split list to strings?

Considering a list: lst = {"1", "2", "3", "4", "5", "6"} How can I have two strings : str1 = "1, 2, 3" str2 = "4, 5, 6" ...
0
votes
1answer
26 views

Add elements of one list to sublists of another list [duplicate]

I have the following list of sublists with different lengths {{1,1,1},{2,2},{3,3,3,3}} and a second list {4,5,6}with the same ...
19
votes
3answers
341 views

Bug in MovingMap (breaking change between version 10.1 and 10.0.2)?

The MovingMap window spec has been changed between version 10.1 and 10.0.2. Version 10.0.2 ...
5
votes
2answers
169 views

Create a list of rules built from data set fields

I want to convert a dataset to a list of features and a list of target values, for use in Predict and also more generally. I know ...
0
votes
1answer
32 views

Strange behaviour of Append [closed]

I have the following situation and I completely do not understand why the second system can be solved but the first (of the same equations, as it seems) cannot. How is it possible? ...
0
votes
4answers
112 views

Make a program that does union of two lists

I have to make a program that gives as a result the union of two lists using a For loop. I can't figure out how to inspect if the elements of a list are different. ...
2
votes
1answer
54 views

sparse array with list [closed]

i'm trying to populate a sparse array with lists in certain positions, i tried the following code, ...
4
votes
3answers
117 views

How to map over inner keys of nested Associations?

Considering an association: <|"a" -> <|aa-> "asc", bb-> "asd", cc-> 0, ImageType -> "asd", dd-> "asd"|>|> How can I make the inner ...
4
votes
4answers
597 views

Writing a circular matrix

I have two square matrices, $A$ and $B$, of the same size, say, of $m \times m$. What I want is to write a programme/function of three variables, $A$, $B$ and $n$, that outputs the $mn \times mn$ ...
1
vote
2answers
50 views

How can I manipulate this list?

I performed a loop with Table where I solve a system of 4 equations that depends on two parameters: eta and p. I create two lists for each parameter as follows: ...
2
votes
4answers
195 views

How to switch from array to string?

Considering we have an array: a = {2/3, 4/5, 9/7, 3/7, 1/7, 1/9}; How can I get this to be: "2/3 4/5 9/7 3/7 1/7 1/9" ...
9
votes
5answers
361 views

Most efficient way of making pair list from a list

I have a bunch of datasets which looks like: 3 7 1 6 5 8 2 4 1 2 8 1 5 2 5 ... and I need to make a list of pairs such that the first element makes a pair with ...
4
votes
4answers
110 views

Creating a new list from other two lists using for loops

I have two lists 'ups' and 'downs' where they are composed of positions of an element in a matrix and their weight. For example, ...
4
votes
4answers
184 views

How to highlight the elements in a list that match a pattern?

For example, {{1,2,3},{1,2,3,1,2,3,4,5}}with pattern {1,_,3}is transformed to ...
0
votes
3answers
52 views
1
vote
3answers
48 views

Delete permutations of subtables in a table [closed]

I've got a table of tables: $A=\{\{a,b\},\{b,a\},...,\{a,b,c,d,e\},\{e,d,c,a,b\},...\}$. How do I do to remove backward duplicates, or more generally permutations of duplicates in the table? For ...
0
votes
1answer
34 views

Create a Table depending of two variables [closed]

I tried to create a table depending of two variables as: W= Table[{G[[i]], G[[j]]}, {i, 1, 3}, {j, 1, 3}] I wanted it to look like ...
6
votes
3answers
89 views

Comparing elements of a set and deleting elements based on a criterion

I have a function that has two inputs. The first input is a set of 2-element sets, and the second input is a single 2-element set. My function complements each 2-element set with the second ...
0
votes
0answers
39 views

Procedure argument value change [duplicate]

I'm trying to create my own hamiltonian cycle algorithm using Mathematica for school, and I'm stuck on a syntax issue. I get the following error: ...
3
votes
4answers
204 views

How to switch from List of rules to Association?

Considering we have a list of rules: ...
7
votes
0answers
90 views

ListConvolve Memory Hemorrhage

I wrote a routine that convolves an impulse response array with a test array and checks for the RMS difference between that convolution and a data array. I do this iteratively so that I can modify the ...