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

learn more… | top users | synonyms (3)

1
vote
0answers
100 views

New list generated from the sum of elements taken from two lists

I have been using mathematica for a while, but I have problem wrapping my head around list manipulation functions. I would appreciate any suggestions. Here is what I want to do. ListV is a list of ...
1
vote
0answers
34 views

How do I define a tensor from another tensor with summations? [duplicate]

Let's say we have a rank 2 tensor $g_{ij}$. This is basically a list with a Depth of 2. Now I'd like to calculate another tensor ...
1
vote
2answers
159 views

Discretizing data using quantiles in Mathematica

I am trying to discretize a long array of real numbers into a uniformly distributed integer array. To do this I am identifying the quantile where each real value sits and writing it out to the output ...
1
vote
1answer
94 views

Testing a List inside of an Table if it is != 0 [duplicate]

I'm new to mathematica so I hope this is not a too stupid question, but I couldn't find a solution in the mathematica documentation. I've got a normal table, initialized with "0" as entries. In the ...
1
vote
0answers
186 views

Using Part within a Compiled Command

I'm looking to define a multi-line function that makes use of the "Part" command. A toy example: ...
1
vote
0answers
69 views

Produce {f[x],g[y],h[z]} in as many ways as possible [duplicate]

I have two lists of equal lengths but for my task I will use 3-element lists , namely {x,y,z} and {f,g,h}. The first contains ...
1
vote
1answer
145 views

How can I pass in parameters for multiple controls to a function that returns a Manipulate?

For instance, I have a some "commands" that I use regularly, for example: ...
1
vote
0answers
72 views

The number of real values assumed by combinations of complex roots of a decic

Define complex conjugate as the pair of complex numbers $a+bi,a-bi$. Assume you have 5 such pairs and they are the 10 roots $x_i$ of a 10th-deg equation with integer coefficients. In general, how many ...
1
vote
0answers
38 views

How can I access numerical values of variables calculated with Solve? [duplicate]

I am trying to calculate some thermodynamical cycles so I often use lists with equations. Here's a simple example: ...
1
vote
0answers
35 views

How to divide all rows of a matrix by their row sums [duplicate]

I've got a general matrix K that I would like to divide it's row's by the row sums of the matrix. I could get this going by doing ...
1
vote
0answers
94 views

Optimized subset algorithm implementation

I was reading a paper from Mathematica Journal.It mentions a code for calculating subsets. ...
1
vote
0answers
147 views

Why doesn't ParallelMap improve the performance of FoldList?

This question arose during my analysis of the following problem: filling gaps. (The code used here is Simon Woods's work.) FoldList seems to not cooperate with ...
1
vote
0answers
60 views

Sorting Eigensystems [duplicate]

SO I have this code: ...
1
vote
0answers
144 views

Transferring a list from one notebook to another [duplicate]

I have Mathematica code split into two notebooks. The first part is supposed to run and output a list of numbers into a text file, using Export. The second part ...
1
vote
0answers
85 views

Non Commutative Multiply [duplicate]

Possible Duplicate: Non-commutative symbolic linear algebra I want to multiply two matrices, for example, A = {{e, f}, {g, h}} B = {{a, b}, {c, d}} ...
0
votes
3answers
1k views

How to make all values positive?

So I have a list of data that contain both positive and negative values, and I am wondering what I have to do in order to make all the numbers positive.
0
votes
4answers
84 views

Drop row if sum of part of row is equal to zero

My problem is the following: Suppose I have a matrix A which looks the following: ...
0
votes
2answers
821 views

How to generate table without comma and bracket or get rid of those?

I want just data without comma and brackets. Even TableForm is not working for me. For example, the general pattern of my table is ...
0
votes
1answer
3k views

Table - find index of the maximum element [duplicate]

Let's suppose that I have table t = {1.23, 3.4, 10, 34, 1.78, 0.98, 12.56}. To take the biggest element I can use Max[t] ...
0
votes
2answers
116 views

Where are the functional programming constructs: `every` and `some`? [duplicate]

Coming from other functional programming environments (e.g., Clojure) I've become accustomed to some functions that I haven't found equivalents for in Mathematica yet. The two I reached for last ...
0
votes
3answers
69 views

Splitting a list of lists

What would be a nice way to split the list list = {1,2,3,{a,b,c},4} into {{1,2,3,a,4},{1,2,3,b,4},{1,2,3,c,4}}
0
votes
5answers
85 views

Merge two lists for List3DPlot [duplicate]

I have a two lists: list1 = {{x1, y1}, {x2, y2}, {x3, y3}, {x4, y4}, {x5, y5}} and list2 = {z1, z2, z3, z4, z5} and I want to ...
0
votes
4answers
135 views

Using levels in MapIndexed

I am trying to use MapIndexed to manipulate a matrix of data but I am having trouble getting the levels parameter to work the way I would like. Suppose that my data ...
0
votes
2answers
248 views
0
votes
4answers
89 views

How to express “if any component in a vector satisfies that …” in Mathematica

For example, l is a list of vectors. I need to delete from l all the vectors with any component larger than 1. How should I do ...
0
votes
2answers
108 views

Defining a function as a sum of several Gaussians

I have a function that is a summation of several Gaussians. Working with a 1D Gaussian here, there are 3 variables for each Gaussian: A, ...
0
votes
2answers
121 views

How can I select elements that are true

I have a list of lists. For example, list = {{0,1,0,1,true},{0,0,0,0,false},{0,1,1,1,true},{1,1,1,1,false},{2,2,2,2,false}} I'd like to find all lists that ...
0
votes
3answers
101 views

How to get the indices of values in a list which are NOT an specific integer?

I got a real array A, where Dimensions[A] == {5000, 5000, 5}. Some of the values in A are ...
0
votes
3answers
313 views

Finding an index with certain conditions

EDIT: I need to find out an index i which depends on certain conditions and I'm not able to implement it. I have a list (time points) $t_i$ and two constants $a,c$ ...
0
votes
2answers
104 views

How do I perform the riffle function backward? [duplicate]

I know riffle will combine the lists {1,2,3} and {a,b,c} to be {1,a,2,b,3,c}. Is there a way to work backward and split the list {a,b,c,d,e,f} to be {a,c,e} and {b,d,f}?
0
votes
2answers
98 views

adding a 1 to all second elements

I want to add 1 to all second elements but I am running into a "level" problem I believe here is my code: ...
0
votes
3answers
250 views

How to solve correctly inside a DO loop and then plot

Here is the corresponding code First the equations setup ...
0
votes
3answers
770 views

Find the number of nonzero elements

How do you find the number of elements in a matrix that are non-zero. For instance, the following matrix has 5 nonzero elements. ...
0
votes
1answer
330 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: ...
0
votes
2answers
108 views

How to evaluate the sum using values from the data being input

I have a problem in evaluating a sum using values from data I input. Suppose I have data = {1, 3, 5, 6, 8} If I want to evaluate the sum of my data (1+3+5+6+8), I ...
0
votes
1answer
894 views

How to get data from For loops to plot it?

How can I get data from For loops to use in ListStreamDensityPlot? I tried AppendTo, but it ...
0
votes
3answers
166 views

Trouble understanding a piece of code found on Wolfram Blog

I am trying to go through this Wolfram Blog example: http://blog.wolfram.com/2009/02/12/flag-analysis-with-mathematica/ on country flag analysis. I am having a problem understanding the following ...
0
votes
1answer
207 views

I don't understand ListCorrelate! [closed]

I want to solve a PDE equation (like Schrodinger equation) using finite difference in Mathematica. I don't understand what this code does! ...
0
votes
2answers
56 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
185 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
83 views

Need help to finish this prime signature function?

I'm trying to create a prime signature for line segments. ...
0
votes
2answers
263 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
51 views

How to split (large) arrays like this?

I want to split this table (list/array) ...
0
votes
1answer
61 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
151 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
85 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
83 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 ...