Questions on the manipulation of List objects in Mathematica, and the functions used for these manipulations.
0
votes
1answer
131 views
Frequency of elements in a list
I've got a list in the format of list={{a,1},{a,1},{b,1},{c,1},{b,1}}
And I want it to "compress" into a list of pairs ...
4
votes
2answers
133 views
How can I eliminate equivalent equations from a list?
I want to find the numbers $a$, $b$, $c$, $d$ of the plane $ax + by +cz +d = 0$ which make the distance from the point $M(1,2,3)$ to the plane equal to 2. I tried
...
4
votes
3answers
312 views
Summing along rows or columns of a matrix
I have a list of rows in database such as
{{a,b,c}, {d,e,f},{g,h,i}}
I want to be able to add each row across and each column down (like a spreadsheet).
In other ...
0
votes
1answer
114 views
how to work with list as function parameter
I want to output an arrow based on input from user and I tried writing this small function to achieve this:
...
4
votes
2answers
135 views
8
votes
1answer
237 views
How can I collect data for visualization of quick sort?
I know how to implement quick sort in Mathematica. But I don't know how to get the temp data for visualization, because I used recursion. I want the effect like this.
...
1
vote
1answer
107 views
ListPlot does not recognize my list
I have created a list in Mathematica and for some reason it does not want to Plot my list in pairs {x1,y1}, but instead does {y1,y2} even though I partitioned the list to make it in the correct ...
3
votes
3answers
136 views
How to change a value within a list of lists?
I essentially have two questions, both are related.
1) How do I change a value within a list of lists (I provided a example problem)?
2) Why does my code not work?
I have a list which was created ...
25
votes
2answers
346 views
DeleteDuplicates not deleting duplicates
It is not surprising that DeleteDuplicates[{5,5.}] returns {5,5.} because DeleteDuplicates ...
0
votes
2answers
123 views
Assign the output of a loop [duplicate]
Possible Duplicate:
Creating a table/Matrix during a For loop
Yet another simple question.
...
1
vote
2answers
165 views
ListPlotting data from a table [closed]
A very simple question.
I have a data table with three columns. how can i plot column 1 vs column 3 using ListPlot?
thx in advance
6
votes
6answers
273 views
How can I merge two lists in a special way?
It's been over a year since I've used Mathematica, and I'm having a total brain fart on a home project. I'd like to take an existing list of lists, say,
...
2
votes
2answers
124 views
How can I transform a list of binary digits into integers?
I want to transform a list of binary digits into integers. With the Table function, I produce four lists of binary digits of length 32. Then I tried to turn these ...
1
vote
1answer
124 views
7
votes
3answers
235 views
Find all the last weekends in a year
In order to obtain the weekends of a year you'd use something like this:
...
10
votes
5answers
330 views
Removing elements from a list which appear in another list
There are two lists {a, b, c, a, d, a, e} and {a, c, a}.
I need to remove those elements from the first list
which appears in a second list, to get {b, d, a, e}
2
votes
1answer
106 views
Error in setting matrix elements [duplicate]
Possible Duplicate:
How to Set parts of indexed lists?
For better organization of my code, sometime I use data objects in the form:
...
5
votes
3answers
212 views
Efficiently extracting an array subset given a separate array
I have two arrays. The first array consists of tens of millions of rows and three columns with a string, a number, and a string.
...
7
votes
3answers
187 views
5
votes
3answers
343 views
Ways to compute inner products of tensors
One way to evaluate the following sums is combining Table and Sum:
$u_{abcd} = \sum_{e=1}^3 v_{aeb}w_{ced}$
$q_{ab} = \sum_{d,e=1}^3 v_{d e a}w_{deb}$
It will look like
...
4
votes
2answers
145 views
How find the first element of a list greater than zero (or another criterion) when there is a symbol in the list?
I need to find the position of the first element of a list that is either greater than zero (or some other criterion) or a symbol.
Something like
...
11
votes
3answers
265 views
Optimising 2D binning code
I have a set of (x,y,z) data, 45,000 to be precise and I want to bin the z values in 256 equidistant bins based on their (x,y) values. The final array should be a set of 256x256 array with each slot ...
6
votes
5answers
211 views
Handling holidays in financial time series
I have two lists: list1and list2, which are financial time series with only 2 variables—date and price. The problem is: these ...
5
votes
2answers
171 views
Concatenate strings from different levels of list
After a lot of trouble I've finally come pretty close to what I want to do. I now have a list that looks like this:
...
0
votes
0answers
46 views
How to ContourPlot a Table? [duplicate]
Possible Duplicate:
Why is ContourPlot not displaying this curve?
Why do I have to put Evaluate[] here
I'm trying to plot certain contours of a function $f:\mathbb R^2\to\mathbb R$.
What I ...
0
votes
1answer
110 views
System Identification with large Input/Output Data
I have some questions about system identification.
I made some measurement of current step (input) and voltage response(output) and I want to fine the parameters of my impedance.
The sample rate is ...
3
votes
1answer
84 views
RecurrenceTable with vector
Mathematica can do a RecurrenceTable with a vector, here is a simple example:
RecurrenceTable[{x[n + 1] == 2* x[n], x[0] == {1, 2, 3}}, x, {n, 3}]
with output
...
0
votes
3answers
232 views
Ignore missing data while doing a Mean
I want to compute the mean of a list while ignoring missing values, but I don't find a lot of information on how to deal with Missing data in Mathematica.
I have a list like :
...
2
votes
2answers
89 views
Modify a sub-part of a sub-list only
I have this list:
a = {{{0, 0}, {1, 7}, {2, 0}, {3, 2}, {4, 7}}, {{0, 0}, {1, 0}, {2, 1}, {3, 2}, {4, 7}}}
and I'd like to transform it to this:
...
5
votes
3answers
143 views
Elementwise join
I have two tensors of arbitrary but equal rank n (and equal dimensions): A and B, and I want to get a third tensor of rank n + ...
6
votes
1answer
95 views
Implementing Remainder Tree
I want to implement Remainder Tree based on this. With the answers on SE I've come up with:
...
7
votes
6answers
167 views
List manipulation problem
I have two lists:
u = {{1, 3}, {2, 6}, {3, 9}}
v = {0, 4}
and I want to obtain this list from them:
...
3
votes
2answers
90 views
5
votes
1answer
142 views
How I can use Apply or Map with If?
I have list of objects:
list = {{1, 1, 0.05, 0.05}, {2, 2, 0.05, 0.05}, {13, 13, 0.05, 0.05}};
list = {{x,y,Vx,Vy},{x,y,Vx,Vy},...};
And
...
4
votes
2answers
160 views
How can I get every distinct size-n combination of a list?
Let's say I have a list:
{a, b, c}
I would like to, for say $n=2$ get every distinct pair from that list. That is, the expected result should be, for some ...
1
vote
1answer
76 views
How do I define a function that, when given a list of parameters, plots a family of functions?
So far I've got this:
draw[a_, b_] := Plot[{f[a, b[[1]], x], f[a, b[[2]], x]}, {x, 0, 5}]
The function draw will be used like ...
5
votes
4answers
228 views
Join lists in a list of lists
What's the best way to join two consecutive lists in a list of lists ?
For example if I have the list
x = {{1}, {2}, {3}, {4}}
and I want to get in x
...
1
vote
2answers
110 views
How can I replace part of list and have the replacement affect the initial list?
I have a list:
list = {{1,1,0.05,0.05}, {2,2,0.05,0.05}};
and I want to do this change
...
0
votes
1answer
118 views
Random sample with gap sizes
Lets say I have 101 instances of data with multiple attributes. In particular case, one attribute has 7 unique values. I want to get ...
1
vote
2answers
209 views
How to generate patterns by a list of integers
I have a list of integers {3,4,2,2}.
This list will give patterns {x_,_,y_,y_,_,_,z_,z_,w_,w_,x_} and ...
8
votes
2answers
220 views
How to represent a list as a cycle
I want to select distinct cycles (represented by List).
The cycle {a, b, c, d} must be the same as {b, c, d, a} or ...
0
votes
2answers
125 views
How can I assign some part of data from one list to another list?
I don't know this is correct question or not,but I have a doubt.
I have two Lists names are list1 and ...
16
votes
1answer
236 views
Using Transpose with a list as the second argument
I'm having difficulty understanding the Transpose function. I know what the transpose of a matrix is, not a problem, and I see that applying the ...
7
votes
4answers
274 views
Using MapThread on list of lists
Just a light weight question for learning. If you think this was asked before, please feel free to close it.
I am trying to learn MapThread more, and wanted to use ...
8
votes
5answers
271 views
How can I find these patterns' signatures?
I think I can explain it best starting with an example. I have the following lists:
...
5
votes
3answers
144 views
All values for a function with two arguments without Outer
Given two lists $l_a = \{a_1, a_2, a_3\}$, $l_b = \{b_1, b_2, b_3, b_4\}$ and some function $f$ accepting two arguments, how can I produce a list of all values $f(a, b)$ for $a\in l_a$ and $b \in l_b$ ...
7
votes
1answer
111 views
Transformation rule on a list of non-negative integers
I am trying to create a transformation rule that takes a list of non-negative integer values of any length, finds a non-zero entry in the list, adds 1 to all preceding numbers, subtracts 1 from the ...
1
vote
1answer
130 views
If-statement does not evaluate if condition is true [duplicate]
Possible Duplicate:
How to avoid returning a Null if there is no “else” condition in an If contruct
I know there are other ways to solve this problem. Just because I'm curious I tried:
...
7
votes
6answers
170 views
The locations of (row-wise) minimum elements in a list
I have a list representing a 2D matrix, such as this 3 ⨉ 2 one:
{{2.1, 1.01}, {0.01, 7.2}, {7.8, 2.0}}
Does anyone know how to find the minimum of each row, ...
1
vote
1answer
160 views
Filtering Lists in Mathematica [duplicate]
Possible Duplicate:
Select/Delete with Sublist elements?
I need help in filtering long lists of x,y coordinates.Lets use the following list as an ...

