Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
Questions on the manipulation of List objects in Mathematica, and the functions used for these manipulations.
1
vote
1
answer
119
views
How can I convert an integer to a binary list? [closed]
Given a integer n, e.g. n = 6, convert this to a binary list, ln = {1,1,0}.
7
votes
8
answers
895
views
How can I expand a matrix and fill in zeros?
Given a square matrix like
m = {{1,2,3},{4,5,6},{7,8,9}};
I want to expand it to a 5x5 matrix
k = {{1,2,3,0,0},{4,5,6,0,0},{7,8,9,0,0},{0,0,0,1,0},{0,0,0,0,1}};
In MATLAB, one can do
m[[4,4]]=1;
m[ …
10
votes
5
answers
334
views
Create a list of indexed variables and assign values in one line of code
It is easy to create a list of indexed variables
F/@{1,3,6,8}
I would like to assign values in the same line of code
F/@{1,3,6,8}={2,4,6,0}
but it complains Set::write: Tag Map in F/@{1,3,6,8} is Pr …
3
votes
3
answers
251
views
Getting all solutions to an equation on condition the variables are either 0 or 1
Given a list of 3-bit binary lists
b={{0,0,0},{0,0,1},{0,1,0},{0,1,1},{1,0,0},{1,0,1},{1,1,0},{1,1,1}};
I would like to have all possible solutions to
s={0,1,0};
Mod[a[2] b[[2]] + a[3] b[[3]] + a[4] …
5
votes
6
answers
381
views
What is an elegant way to find where a row of 0's and a column of 0's in a matrix intersect?
I am working on a Mathematica program to construct unitary matrices satisfying specified properties. To complete this construction I need to find where a row of 0's and a column of 0's intersect and p …
2
votes
3
answers
164
views
Given a first row with even valued length n construct a matrix which is both symmetric and p...
For example if n = 4,
row = {1,5,6,7}
Construct the matrix
mat = {{1,5,6,7},{5,1,7,6},{6,7,1,5},{7,6,5,1}}
$\left(
\begin{array}{cccc}
1 & 5 & 6 & 7 \\
5 & 1 & 7 & 6 \\
6 & 7 & 1 & 5 \\
7 & 6 & …