Linked Questions

3
votes
5answers
88 views

Decomposing a list into several two coordinate lists

How can the following list can be decomposed into separate two coordinate lists? list = {{1, {0}}, {2, {0}}, {3, {-2, 0, 2}}, {4, {-2, 0, 2}}, {5, {-2, 0, 2}}}; ...
1
vote
2answers
69 views

How to assemble matrices?

I'm a beginner in Mathematica and have a very basic question. Suppose I have made the following matrices (4x4). $$A,B,C,D,$$ and I want to make the larger matrix $$\begin{bmatrix} A & B \\ C &...
1
vote
2answers
134 views

Flatten a four dimensional array into a matrix

What is the simplest way to transform an array of the form ...
0
votes
2answers
136 views

Creating a nested table

I have a row of values that I partition into a table. row = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}; rowPartitioned = Partition[row, 6] ...
3
votes
2answers
95 views

Manipulation of 3D matrix

Assume that we have a 3D array x, and we would like to split it into 2D slices then cut every slice into some small patches and get all patches in single list ...
2
votes
1answer
361 views

Flatten a list at some level

I wonder if is possible flatten a list at the last level without flattening at the first level, I think that isn't a good explanation so here is my code ...
2
votes
1answer
324 views

Flattening a list [duplicate]

I have a list with dimensions {1000, 1000, 1} and I would like it to have dimensions {1000, 1000}. But ...
11
votes
3answers
351 views

Most efficient way to build block / banded SparseArray

I have a matrix that I generate with a procedure that looks like this: ...
6
votes
5answers
468 views

Part of the nested lists

Suppose I have a nested list where sublists have unequal length. How can I extract all values of the list at specific level ignoring errors if the value at that level doesn't exist. For example: <...
2
votes
3answers
185 views

How to find all prime power factorizations of an integer

I want to put in $n$ and get the possible factorizations into prime powers. Let's say for 24 I want {{8,3}, {4,2,3}, {2,2,2,3}}. The algorithm for doing this on ...
2
votes
3answers
508 views

Applying the vec operator

How to apply the $\operatorname{vec}$ operator in Mathematica? For example, how can I transform a $2 \times 2$ matrix into a $1 \times 4$ matrix as follows? $$ \operatorname{vec}\left( \begin{...
1
vote
0answers
58 views

Trouble in understanding `Table` [closed]

Even after, not only seeing, but understanding on Mathematica SE and also using Table. I am afraid, if I still understand it. Here is one example, which I couldn't ...
10
votes
2answers
383 views

How to riffle matrices

I have four matrices ...
3
votes
2answers
132 views

List extraction

Given the following list: ...
5
votes
3answers
94 views

Adding the data of different tables

I have three tables of data say t1 = {{1, 2}, {2, 3}, {3, 4}}; t2 = {{1, 3}, {2, 3}, {3, 5}}; t3 = {{1, 3}, {2, 3}}; First I want to add ...
10
votes
1answer
401 views

Plotting how sunrise times change over the year

I created a somewhat lengthy Python code to show how the time of sunrise varies over a year, resulting in the following figure (daylight savings were disregarded): The dataset can be found here. The ...
12
votes
3answers
303 views

Riffle two matrices COLUMNWISE; where boh matices have the same number of rows

I need to "riffle" two matrices; COLUMNWISE. Say that we have: ...
2
votes
3answers
266 views

How to remove extra levels in list [duplicate]

My question is how to turn a 4-level matrix (notice one extra level) A = {{{{1, 2, 3}, {4, 5, 6}}}, {{{7, 8, 9}, {10, 11, 12}}}}; into the following: ...
1
vote
1answer
113 views

Combining the entries of two lists [closed]

I have two lists {a, b, c, d, e} and {1, 2, 3, 4, 5}. I want to creat a new list of tuples as follows ...
10
votes
5answers
331 views

Transpose two uneven lists [duplicate]

I am trying to plot two lists using the ListPlot command. I need to merge two lists. The two lists I have are: ...
1
vote
1answer
62 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: ...
10
votes
3answers
1k views

How to build a matrix from a set of vectors and other matrices using ArrayFlatten

I want to build a 6 by 3 matrix, from the following: one vector is 3 by 1, then a matrix, which is 3 by 2. These will go to the top 3 rows. Now the bottom 3 rows, I'll have 3 vectors each is 3 by 1. ...
0
votes
1answer
155 views

How to understand the extensional usage of Flatten? [duplicate]

Recently, I have been reading Mathematica program that written by many advanced Mathematica user, like Mr.Wizard, J.M., Kuba,etc to improve my programming capacity In the On generalizing Partition[] (...
3
votes
2answers
254 views

Inserting rows of one matrix into rows of another matrix sequentially

I have two matrices M1 and M2. Both have same number of columns but different number of rows. I want to make a new matrix M which should have 1st row form M1, second row form M2, third row form M1, ...
9
votes
2answers
1k views

Understanding Transpose

It is very likely that it is my lack of math skills that is showing up here. However, I think Transpose is such an important function that I need to master it. So I ...
3
votes
2answers
199 views

How to convert multidimensional matrix into regular matrix?

I have this multidimensional matrix: {{{{a1, a2}, {a3, a4}}, {{b1, b2}, {b3, b4}}}, {{{c1, c2}, {c3, c4}}, {{d1, d2}, {d3, d4}}}} I would like to convert it into ...
2
votes
2answers
422 views

How can I thread lists of different sizes?

What I need is the equivalent of Maple's zip(+, A, B, 0). Sure I can get it with: ...
-5
votes
5answers
848 views

Translating MATLAB's cell2mat into Mathematica

How I can define a function in Mathematica such that it acts same as the cell2mat command in MATLAB? Example (in MATLAB): ...
17
votes
5answers
3k 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 ...
26
votes
1answer
1k 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 ...

15 30 50 per page