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

learn more… | top users | synonyms (3)

0
votes
2answers
54 views

Sorting non-numerical lists [closed]

The Sort function will by default sort from lowest to highest. In[1]:= Sort[{3, 1, 4}] Out[1]= {1, 3, 4} However, if the list ...
0
votes
2answers
175 views

NestWhile application

I have the function which take the last list in nested list, reduce it somehow in several ways so the length of list reduces and output new list wherein input list appended with defferent reduced ...
0
votes
3answers
173 views

How to construct pairs in a list?

I have an expression like this, input = x[1] x[2]^3 x[5]^2; Fist step, we can get a list from the input expression, ...
0
votes
1answer
81 views

Need help to finish this prime signature function?

I'm trying to create a prime signature for line segments. ...
0
votes
2answers
259 views

Calculating average distance

I have a program that gives the average distance as the output. When I tried to repeat finding the average distance 100 times using Table, It failed to generate the output. This is the program. ...
0
votes
2answers
245 views

Recursion on a moving window

I need to apply some computations to a moving window of $N$ items in a time series and I am struggling with doing recursion and shifting the considered window. To illustrate, please consider the ...
0
votes
1answer
59 views

Duplicate values n-times [closed]

I already asked how I can take the list {1,2,3} and get {1,1,1,2,2,2,3,3,3} out of it, adding degeneracy to the problem. So far ...
0
votes
2answers
150 views

Indirect transformation based on a list of data points

I have a set of data which describes the Intensity function $Int(q)$ as a function of $q$. The data list provided below provides the shape of $Int(q)$ versus $q$.How can I use this information to ...
0
votes
2answers
47 views

Defining a function from a list [closed]

I have a list of 49 numbers, and I would like to define a function f such that f(n) is simply the nth number in the list. How can I do this?
0
votes
3answers
84 views

Positions of a string in a list [closed]

Sorry for the bad title..Didn't know how to describe this, feel free to change it to be more specific. I have a list in this form: ...
0
votes
2answers
81 views

Merging two lists by prepending elements

Being a newcomer to Mathematica, I have the following question. Given x = Range@9~Partition~3; and y = {a, b, c}; I want ...
0
votes
2answers
228 views

ListPlot with spherical coordinates with data from file [closed]

I have a file that is a table of values for r, $\theta$ and f(r,$\theta$) with r and $\theta$ being spherical coordinates, $\phi$ being 0 the whole time. The data thus looks like ...
0
votes
2answers
90 views

How to generate a list with a loop, and put it into a variable?

I am pretty new to Mathematica and to coding in general. I want to do a very specific thing, but I unable to do it. Please explain in detail how I can make this work. Here's the details on what I am ...
0
votes
2answers
124 views

How to partition three years of data into daily samples

I'm trying to find mean of temperature data list. The temperature data list has 3 hours steps which means I have 365*8=2920 temperature measurements per year. My data are temperatures of 13 years. ...
0
votes
2answers
147 views

Apply Eigenvalues to a list of matrices

I would like to apply Eigenvalues[] to a list of matrices as in the following ...
0
votes
2answers
93 views

List of lengths of runs of elements

I have a list where a few distinct numbers occur, e.g. {41, 41, 41, 1009, 41, 41, 41, 41, 41, 41, 41, 1009, 41, 41, 41} I want to extract the information of how ...
0
votes
2answers
127 views

Result of NIntegrate ploting to list

I've been working on a project where I need to make two Plots. Those plots are of the form: ...
0
votes
2answers
141 views

Associate the elements of a table

I have a table form as: table = {{a, 6}, {b, ff}, {c, 2}} I want to associate the first element of each pair from the table to the second element of the pair as ...
0
votes
1answer
83 views

Use a pre-computed list instead of RandomInteger

I would like to replace RandomInteger[{1, 10}, {10, 10}] in the following code: ...
0
votes
2answers
163 views

Combining graphics & lists / tables

I have: created with: ...
0
votes
4answers
95 views

Seek a quick way to bring standard order back to original after Complement [duplicate]

the Complement gives result in standard order. But that's not what I want. I want it to keep the original order. say I have a list ...
0
votes
2answers
141 views

How to put a list of values on a single axis and add custom labels

I have a table in the following format: Apple 2 Pear 3 Banana 5 Orange 6.5 .... I would like to put the values on a single horizontal axis and add corresponding descriptive labels (apple, pear, ...
0
votes
1answer
137 views

Stopping- threshold and stopping- time of stochastic processes.

Rod Lm helped me to generate the following code, which I want to extend a little bit. So my intention is to use the threshold (the green line) as boundary in the following way: as soon as the process ...
0
votes
1answer
159 views

Problem with importing format of data from Excel?

I am trying to import data from Excel. It is located in a single column of the Excel file but each cell contains a comma separated pair of two values as a,b. When I am importing them I have this ...
0
votes
1answer
120 views

Where do those nulls come from? [closed]

I have seen discussions of unwanted nulls in the output in the context of building lists with conditions on the elements, but that is not involved here. I would like to know where the nulls come from ...
0
votes
2answers
79 views

Extract a List of Co-ordinates from a List of Complex Solutions

Let's say I have this list of solutions from a previous computation: ...
0
votes
1answer
60 views

Finding duplicates in a list

I have a list of integer, and I want to know if the list contains any duplicates. My code is working, but I feel there is a more straightforward way of doing this ...
0
votes
1answer
50 views

Finding list position in array [closed]

Lets say I have the list {{1,2},{1,3},{2,4},{1,3,5}} Is there a way I can get the positions of the lists starting with 1? ...
0
votes
2answers
88 views

How do I sum up p items in a sequence?

I have the following sequence list = {p1, p2, p3, p4 ....} I am summing up the p items as follows: p1 + p2 + 2*sqrt (p21*p2) = p12 p12 + p3 + 2*sqrt (p12*p3) = p123 p123 + p4 + 2*sqrt (p123*p4) = ...
0
votes
2answers
150 views

Extract X value from corresponding Y value from a List or Transpose [closed]

I have a list of X values and Y values separately, and also together with: data=Transpose[{X,Y}] This data is from a chromatogram, and I want to extract the ...
0
votes
1answer
158 views

How to load data into a Manipulate expression

I have data showing truncated octahedron geometry changing with time. How can I read those data into a Manipulate expression? To be specific, I want to manipulate ...
0
votes
1answer
98 views

How do you add options to a function that is being mapped?

Simple example: Normally: ListPlot[list, Joined->True] If I want to map ListPlot how do I keep the ...
0
votes
1answer
57 views

Drop last element of parts of a list [duplicate]

just a simple question for now I guess: I have a list: list={{1, 2, 1}, {1, 10, 1}} I simply want to Drop the last element of the two entries of the list, that ...
0
votes
2answers
113 views

Having problems with ListPlot and a PaddedForm wrapper

I defined a function f[x_] = x^3 2 x. Then I had to construct a table showing vertically, the values of f corresponding to x on ...
0
votes
1answer
166 views

Generating all “from n choose k” configurations of a simple list [closed]

Suppose that I have a 1-D list called myList. Here's an example: myList = {"A", "B", "C", "D"}; I want to write (or find ...
0
votes
2answers
63 views

How to obtain all the partitions in a set $A$ such that the union of these partitions equals $A$?

I'm trying to make a visual proof on the irrationality of $\sqrt{2}$. At the moment, I've created a figure to show that $b^2$ elements always constitute a square: And I want to show that it's not ...
0
votes
1answer
152 views

Problem ListLinePlot with 2 data sets [closed]

I am trying to plot 2 data sets with ListLinePlot and my problem is that no graph shows up. When I plot a single data set i.e. ListLinePlot[Aluminium] it looks ...
0
votes
2answers
122 views

Selecting index position of data from a table that is less than a certain value

I have a table of numbers with a few thousand entries, and I'm trying to find the first index that is less than a particular value. An example of the table I'm working on is as follows: ...
0
votes
1answer
111 views

mathematica apply list of functions to the same arguments [closed]

How can I apply list of functions to the same arguments? e.g. ApplyFun[{fun1,fun2,fun3},{arg1,arg2}] I looked here and could not find: ...
0
votes
1answer
141 views

Using DeleteCases with multiple AstronomicalData properties

I am attempting to use AstronomicalData and DeleteCases together to remove invalid cases of two properties while listing the ...
0
votes
2answers
74 views

How can I make my output to be added to an existing list?

v = {{0, 0, 0}, {1, 0, 0}, {1, 0, 1}, {0, 1, 1}, {1, 1, 1}} For[i = 1, i < 6, i++, For[e = 1, e < 6, e++ 1, Print[Mod[v[[i]] + v[[e]], 2]] ]] I ...
0
votes
2answers
85 views

What's wrong with my use of Do? [closed]

My code is: Do[Print[number[[i ;; (i + 4)]]], {i, number}]. The variable number here is a list consisting of 1000 digits. My ...
0
votes
1answer
206 views

Performing matrix multiplications with a list

I have a question in regards to PseudoInverse. I have $A$, an $n\times 2$ matrix, and when I want to compute $(A^T A)^{-1}A$, by using ...
0
votes
1answer
146 views

How do you find the longest sublist within a nested list

Say, I have a list stuff={{eat,tea,now},{how,did,you,say},{the,cat,ate,was,can},{win,din,sin}} I have a nested list and I want to find the list that has the most ...
0
votes
4answers
63 views

Don't understand why Do-loop index is not evaluated in Play expression

So here is some weird behavior: When I create a list inside a loop whose elements are Play functions, with arguments that depend on the counter, it is as if the counter is being stored symbolically, ...
0
votes
1answer
145 views

johansen test error in code

Cross-posted at the Wolfram community forum I have found this code on a forum, apparently it worked in a previous version of mathematica. Now when I run it, it keeps running for ages. I am not able ...
0
votes
1answer
345 views

List plot joined with stair steps instead of diagonal lines

What's a simple way to plot a list of points so that they're joined with stair steps instead of straight lines between the points? I'd imagine something like... ...
0
votes
2answers
133 views

List manipulation - End loop

Given are two matrices (a & b). I want to end the For-loop if all values in the matrix (a minus b) are smaller than 7, in contrast to any value in the matrix (a minus b) is smaller than 7. Can ...
0
votes
3answers
96 views

How can I generate a generalized product to two lists in a special way? [duplicate]

Let's say I have two lists, and I'd like to generate a "cartesian product" from these two. Specifically Inputs: A = {{{1}}, {{2}}, {{1}, {2}}}; B = {8, 9}; ...
0
votes
1answer
86 views

Breaking up data and finding independence

Suppose I have the list with elements (either 1 or 4 as the last digit) as follows: ...