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

learn more… | top users | synonyms (3)

0
votes
0answers
25 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
49 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
42 views

Summimg peculiar nestings

I have some lists with peculiar nestings: ...
4
votes
3answers
183 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
119 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
64 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
50 views

How to use MemberQ for such Variables?

This is NOT the desired out come. I want this test to fail: ...
1
vote
2answers
56 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
70 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
98 views

How to efficiently get a list like this?

I want a function myfun that generates list like this ...
10
votes
5answers
311 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
112 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
50 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
49 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
55 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
218 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
134 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
82 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
68 views

Filtering outliers [duplicate]

I have a question. My data is: ...
1
vote
1answer
87 views
4
votes
3answers
150 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
467 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
288 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
100 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
58 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
495 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
143 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
99 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
123 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
205 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
117 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 ...
0
votes
1answer
48 views

Organizing and displaying list-like result

This is most likely a piece of cake for you guys, but it is difficult for me. Related to a math problem, I examine if ...
1
vote
1answer
58 views

Replacing members of a list with elements sampled without replacement from another list

I have a list of element pairs: pairList = {{1,2}, {2, 3}, {3, 4}, {4, 5}}; I'd list to pick a subset of the elements in this list: ...
0
votes
1answer
45 views

Help for properly writing simple derivative expression

I need help to write the following expression (only 1 iteration): f(x) = ...some basic function... f[X0,...,Xp] = f(p)(x0) / p! What I have so far: ...
0
votes
0answers
65 views

DeleteDuplicatesBy function does not exist

I'm using 10.0.1.0 x64 on Windows. The DeleteDuplicatesBy function appears in autocomplete lists, and is present in the documentation, but does not appear to ...
10
votes
1answer
188 views

Max element of a list with a custom ordering function

I need a function to find max element of a list according to some custom ordering function, assuming that the function implements a total order (elements being compared might not even be numbers). ...
4
votes
4answers
163 views

Extract Specific Dates from DateList

Hopefully this is an easy question but I couldn't find an easy answer anyway. Surely there is some simple way to splice this... I want to take a large datelist in the format of {{2014,12,31}, value} ...
8
votes
6answers
282 views

Adding list of list to a list

Hello I need some help on how to add a list to a list of list. The program would have to do as below: {{0,0}, {0}, {0,0,0}}+{1,2,3,4,5,6} will give ...
3
votes
2answers
95 views

Counting the total number of instances of some collection of objects in a list

I have a list of some sort list = {"l1","l2","l3","l4"} and I'd like to count the sum total number of occurrences of n of the ...
1
vote
1answer
83 views

How to specify x axis values in the ListPlot[] [closed]

I am using ListPlot[] to plot a list of 1000 values. I need to specify the value shown in x-axis.It seems that is a classic question but I have looked for in this forum but I did not get any response ...