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
22 views

Using Manipulate for Lists in Matrixform

At first sorry for my english, i hope everyone can understand my problem: I like to use Manipulate for doing something with lists and i like the lists to be in Matrixform. Is that possible? I tried ...
4
votes
1answer
53 views

Counting subsequences (i.e., patterns) within a list?

I would like to count the number of subsequences in list. Say I have data given by: data = {1, 1, 1, 2, 1, 2, 2, 2, 1, 2, 1}; I would like to count the number ...
3
votes
1answer
81 views

Given a list made up of subsets of an alphabet, how can I use associations to create a Boolean dictionary of the given list

I have a list of 30,000 elements, each of the element is a list in itself {{a, b}, {p, q, r}, {a, p}, ..., {z, x}}. Second one contains unique elements ...
8
votes
7answers
259 views

Input a square matrix and return a list of the matrix entries read by antidiagonals

I have a square matrix: {{1,2,3},{4,5,6},{7,8,9}} and I want to get a list: {1,2,4,3,5,7}
0
votes
2answers
60 views

Cases Except - Selective Exclusion

Please help me use Cases,Except on list data. I just want to remove all primes, or equivocally to see only the values in the list produced that aren't prime. the prime factorization of those values ...
6
votes
4answers
146 views

Define Function with Sum over a list

I want to define a function that would symbolically look like $$ t(s,\underline{a})=\pi s + \sum_{n=1}^{n_{max}}a_n\sin(n \pi s) $$ (something like a finite Fourier series). Here $s\in [0,1]$ and ...
1
vote
2answers
38 views

Evaluate list of functions at a certain point

I have a list of functions (actually they are derivatives) of the type: {D[g[x,y],x],D[g[x,y],y]} I would like to evaluate all of these functions at a point, ...
3
votes
4answers
89 views
1
vote
2answers
76 views

How do I remove the quotation marks from each element of a list containing dates that I have import from excel?

I've been stuck in this problem for 1 week. I just want to make a graph (Log-Return vs time (in year, month, day)). The code is: ...
0
votes
0answers
38 views

Selecting values over lists for discrete inputs in NDSolve

I'm currently trying to simulate a step response in a simple tank system with NDSolve. I would like it to start at say time 2 (the precise time is not important). ...
0
votes
2answers
55 views

For Loop in Mathematica {n, factored form of x^(n)-1} for 95<=n<=105

I am new to mathematica. I am trying to write a for loop to print out {n, factored form of x^(n)-1} for 95<=n<=105. I have followed the directions of another for loop, and gotten the following ...
1
vote
1answer
46 views

Summimg peculiar nestings

I have some lists with peculiar nestings: ...
6
votes
3answers
221 views

Finding all sublists or substrings of a given list/string

Given a list or string, how do I get a list of all (contiguous) sublists/substrings? The order is not important. Example for lists: ...
2
votes
4answers
124 views

accessing elements of nested list

I have a list of the form: toy = {{a, {b, c}}, {d, {e, f}}, {g, {h, j}}, {k, {m, n}}}; and would like to create the list ...
1
vote
1answer
65 views

How to use a list of rules as a data set

I have a file of models that I have saved that I want to be able to call in another program to be solved with NDSolve. Can I use ...
0
votes
1answer
51 views

How to use MemberQ for such Variables?

This is NOT the desired out come. I want this test to fail: ...
1
vote
2answers
59 views

Insert an element to AdjacencyGraph

I'm not able to insert an element to mine AdjacencyGraph. I suppose that i should modify my AdjcencyMatrix: ...
2
votes
2answers
74 views

How to rearrange structure and type of an imported dataset?

I have a bigger dataset imported from Excel. Its elements have a form of {time, data}. Day is irrelevant and I would like to have the time in decimal form e.g. 10:30 is 10.5 ...
2
votes
2answers
106 views

How to efficiently get a list like this?

I want a function myfun that generates list like this ...
10
votes
5answers
323 views

For a given expression: if it appears, remove it, but if it is absent, add it

While reformatting Szabolcs's code from (42660) I noticed this interesting operation: ...
3
votes
1answer
116 views

linear combination of successive elements in a list

Say I have a list $E$ and want to build a list $F$ with the entries $F_j=E_j-2E_{j-1}+E_{j-2}$. I know that this happens to be achievable by iterating the function ...
0
votes
1answer
51 views

Correcting a gap in ListPlot

This is a small sample of my data ...
0
votes
0answers
45 views

Generating a list of overlapping end coordinates [duplicate]

I'm a very new user to mathematica so this may be a silly question. i'm trying to evaluate some integral between end coordinates of some evenly spaced range. my range is defined by the number of ...
1
vote
1answer
50 views

How to delete more than one (specific) elements in a list

lst = {a, b, c} DeleteCases[lst, a] Delete one specific element a. How do I delete elements ...
3
votes
1answer
56 views

Converting path list to the nested list

I'm trying to convert the plain path list to the nested tree list like the following codes. ...
3
votes
3answers
220 views

Use map on a different level

I have just started to get used to Mathematica's Map, Apply, and related functions, and I can't figure out how to do maps that require working "one level down". For example, I am currently trying to ...
2
votes
2answers
135 views

How to apply # on different lists? [duplicate]

If I have list1 = {1, 2, 3, 4} list2 = {5, 6, 7, 8} How can I do so, that function[#1, #2] takes ...
4
votes
1answer
83 views

Parsing string with nested information

I am trying to parse a string, but I have no idea how to solve the following problem ...
2
votes
1answer
69 views

Filtering outliers [duplicate]

I have a question. My data is: ...
1
vote
1answer
87 views
4
votes
3answers
152 views

Selective threading of the Rule

How can I change form1 to form2 form1 {10000, 10004} -> {2, 2, 637} form2 ...
0
votes
0answers
71 views

How to accumulate elements in a list using Reap and Sow [duplicate]

Does anybody know how to rewrite this fragment using Reap and Sow instead of AppendTo. I need to reduce the execution time. Thank you. ...
4
votes
4answers
470 views

All binary sequences with length n

I don't know if there is a built-in function for this, but I'm thinking about something like this Outer[List, Table[{0,1},{n}] ] But ...
8
votes
3answers
290 views

Generalization to AllTrue, AnyTrue and NoneTrue

I am wondering if there is a natural Mathematica way to generalize those functions. To be specific, All three functions AllTrue, ...
1
vote
2answers
102 views

Plot a bunch of lines in 3D from point data

I have a 12*25 array, wherein each entry is of the form $\{x,y,z\}$. So 12 different $x$ values, 25 different $y$ values and 12*15 $z$ values in all. I'd like to plot 12 curves of various $x$ values ...
1
vote
2answers
59 views

Incomplete Parallel Mapping

I am still struggling on how to nicely handle list operations in Mathematica, and perform simultaneously parallel computation. We consider a tab of the form ...
9
votes
6answers
500 views

The longest run of at most k different elements in a list

I have a long list with ca. 500K elements. The list contains about 10K different elements. For simplicity let’s assume the list is of the following form: ...
3
votes
1answer
132 views

Calculate efficiently an expensive hermitian matrix

I want to compute a matrix $M_{pq}$, for which the calculation of each coefficients $M_{pq} = f(p,q)$ is an expensive function. I know that my matrix is hermitian, so that $M_{qp} = M_{pq}^{*}$. As a ...
4
votes
2answers
145 views

Finding the Position of the Minimum Neighbor for Each Element in a Large Matrix

I have a large matrix ($6020\times 8452$), and I want to create a new matrix where the relative position of the minimum neighbor is each element in the matrix. For example, if I had the matrix ...
2
votes
1answer
100 views

How get repeated elements from two lists

How to write a code that takes an certain element related to a given subset in a LIST 2, that occurs also in a LIST 1? for example, there are two lists: ...
1
vote
1answer
47 views

Compute the evolution of percentages from a data file

My data is stored in external .out files which contain six columns and a large number of rows. I know that I have to provide a small sample but the structure of my data is so unique, so I provide the ...
4
votes
2answers
182 views

Generate lists that satisfy a condition in an efficient way

The following code produces lists of sublists with maximum length 5 that shuffle zeros around an ordered list (here {1,2}). It produces all permutations while ...
2
votes
2answers
124 views

How to produce a table with column and row headers included?

I have searched and have not found a solution. n = Table[i^2 + j*3, {i, 3}, {j, 7}] // TableForm Export["stuck.xls", n] ...
0
votes
1answer
51 views

How to split (large) arrays like this?

I want to split this table (list/array) ...
0
votes
1answer
78 views

Extracting parts of a list subject to a condition

I've got a list like following: ...
1
vote
1answer
27 views

Select equation in a list of conditions

I have an equation list {a'[t]==b[t],c'[t]==d[t],x'[t]==y[t]} and upon running FullSimplify[] it becomes ...
0
votes
1answer
44 views

convert list to equation form

Suppose I have a list condition={f'[t]-3,g'[t]-f[t]} and now I want to use DSolve on it so I need to convert the list to ...
5
votes
2answers
103 views

How to use Manipulate to cycle through a list of lists over a function

So I can do something like this which I like: Manipulate[i, {i, {1,2,3,4}}] It lets me pick which specific values I want to allow to be chosen for my function. ...
1
vote
1answer
209 views

Lookup construction using data matrix and Reap/Sow versus AppendTo`s

I am a user of MMA9 and made my own kind of Lookup, which is now a standard command in Version 10. In my program there is a section in which by means of a StringReplace[ ]-command containing a lot of ...
1
vote
2answers
118 views

How to join several list interleaving with some fixed list between?

How to join several list putting some fixed list between? Like this MyJoin[{{a,b},{c,d},{e,f}},{x}] giving ...