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

learn more… | top users | synonyms (4)

0
votes
4answers
99 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
178 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
3answers
109 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
351 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
3answers
76 views

Do not expand matrices in Mathematica calculation

Here is an example of a problem I'm having. Consider that I have defined: omega={{p[t]},{q[t]},{r[t]}} x={{a},{b},{c}} R={{1,2,3},{4,5,6},{7,8,d}} What I would ...
0
votes
2answers
125 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
121 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
411 views

How to solve correctly inside a DO loop and then plot

Here is the corresponding code First the equations setup ...
0
votes
3answers
1k 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
444 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
114 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
994 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
50 views

Dynamic insertion of variables

I have a list of eigenvectors of a given matrix. I need to programmatically modify this list by multiplying each vector by a variable #i, e.g. ...
0
votes
4answers
107 views

How to trim the zeros from the right of a list? [duplicate]

I need to remove the zeros from the right of an integer list up to the first non-zero element. Such as {0,1,0,0,2,0,0}->{0,1,0,0,2}. Padding zeros can be simply ...
0
votes
2answers
70 views

How to change list to a list of points

I have a list of angles {a1, a2, .... , an} and I would like to have a list of points ...
0
votes
3answers
167 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
2answers
77 views

Sorting non-numerical lists [duplicate]

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
218 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
1answer
192 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
3answers
185 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
86 views

Need help to finish this prime signature function?

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

Match a variable name pattern [duplicate]

I have a list of variables: {RBI,RCD,ASD,FGH} I want to select only those whose name starts with R. Using the pattern Rx_ ...
0
votes
1answer
55 views

Mathematica Code Involving For Loops Not Completing All Iterations [closed]

First of all, thank you for taking the time to read this. I'm working on a portion of code related to the genetic algorithm that is not producing the expected results. What the code is supposed to do ...
0
votes
1answer
58 views

Position vs Part [closed]

What's the difference between Part and Position? How can I "move" from the form used by Part to that of Position (and vicerversa?) Thanks!
0
votes
3answers
57 views

Apply every function from a list to an expression

I would like to apply a list of functions to an expression, like ApplyList[{Re, Im}, Exp[I x]] = {Cos[x], Sin[x]} How do I do that?
0
votes
3answers
113 views

How to take dot product of every element in a list?

I have a list of coordinates (coord): ...
0
votes
1answer
82 views

Trapezoid approximation to definite integral

this question is related to Basic question on defining more rectangles. I now was trying to adapt the code by MarcoB to get the approxiamtion of the integral by trapezoids, and I used the function ...
0
votes
4answers
117 views

Make a program that does union of two lists

I have to make a program that gives as a result the union of two lists using a For loop. I can't figure out how to inspect if the elements of a list are different. ...
0
votes
1answer
57 views

How to split (large) arrays like this?

I want to split this table (list/array) ...
0
votes
1answer
72 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
162 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
3answers
110 views

Positions of a string in a list [duplicate]

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
92 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
1answer
199 views

ListDensityPlot with discrete bins [duplicate]

We consider a table of the form data = Flatten[Table[{i,j,f[i,j]},{i,1,ni},{j,1,nj}],1] The function f[i_,j_] has been made ...
0
votes
2answers
95 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
134 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
257 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
101 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
169 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
87 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
185 views

Combining graphics & lists / tables

I have: created with: ...
0
votes
4answers
97 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
153 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
175 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
131 views

How to extract data from a list? [duplicate]

I have a long list of coordinates defined in some 8D space. I need to extract the first three coordinates only. How ? For example : ...
0
votes
1answer
125 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
82 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
3answers
72 views

Confusing “Part::pspec” and “Part::partw” following call to ParametricPlot3D

The problem I'm having is that the function definition given below continually gives me baffling error messages. I'm trying to turn a list of 3D points into a function that approximates a curve by ...