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

learn more… | top users | synonyms (3)

0
votes
1answer
199 views

Passing lists to functions in a manner that works like pass-by-reference in other languages?

Is it possible to use a list as a variable, i.e., to pass it by reference to a function? In particular, I have a two-dimensional array and a function to get one element specified by its position: ...
0
votes
2answers
266 views

Finding max value of each column of 4x4 Array

I have the following array in both MatrixForm and List form ...
0
votes
1answer
195 views

How can I build a GraphicsGrid of fixed size that rearranges the empty plots?

OK, let's make one final attempt; they say the third time is the lucky one! Following @rm-rf 's suggestions, I will try to be as clear as I can. My Mathematica code reads and plots simultaneously ...
0
votes
2answers
120 views

Create a Matrix out of two matrices

I have two matrices A = {{a1,a2},{b1,b2}} and B = {{x1,x2},{y1,y2}}. I would like to create out of these matrices a new matrix ...
0
votes
1answer
90 views

Making a list from equations

I want to make a list (efficiently) which is the set of lattice solutions of the following equations (depends on $k$): $x_0\geq 0$ and $x_i\in [0,4k]$ for $i=1,\ldots,4$ satisfies $x_0+x_3\leq k+3$, ...
0
votes
1answer
149 views

Problem with ListContourPlot feeding data format and WeatherData

With following code I am trying to show the mean wind speed patterns for a few geographic locations. ...
0
votes
1answer
584 views

How to calculate the area of a listplot [duplicate]

I need to calculate the area enclosed in a two-dimensional listplot and following an answer to a similar question I tried this way: ...
0
votes
2answers
496 views

Finding max, min, and closest root of two dimensional data

I have some data that is two dimensional (traditional (x, y) format) as so: var = {{x1, y1}, {x2, y2}, {x3, y3}} I would like to search through that large list ...
0
votes
2answers
142 views

Convert *.txt file

I would like to Import and Convert a *.txt file which looks like: https://docs.google.com/file/d/0Bw-308nJcF01Yl92RURCLUg4VzQ/edit?usp=sharing and turn it into a Matrix which I can use to make ...
0
votes
1answer
297 views

Keeping axes fixed in an Animate of a 3D graphic

I am using the following code to animate a 20 3D ListPointPlots: ...
0
votes
1answer
71 views

How to get a number, but not a list, of the dimension of your array?

I need to use the dimension of a certain array, to use it as a bounder in a loop afterwards. The problem is that I get a list, when write : ...
0
votes
1answer
155 views

Discrete 3D plots of median ratios of two 2D matrices of lists of values

Lets say I have 2 2D arrays where each cell contains a list of values: Example: ...
0
votes
1answer
43 views

Loops for Unit Root Test

I want to compute some unit root tests on a data generating process. I already split the sample in 100 single samples, but how can I do a unit root test on all of them and store the results in another ...
0
votes
1answer
46 views

Help with programming(using list) [closed]

I would like to make a program which gives me what is the greater natural number "n" less than an arbitrary given natural number "k" which satisfy: for each prime divisor "p" of n, p^2-1 divides n. I ...
0
votes
1answer
27 views

Interactively Manipulate SparseArrays or Lists

I'd love to use SparseArrayor List to group a set of parameters together in a function. ...
0
votes
1answer
39 views
0
votes
1answer
41 views

Sort a multidimensional list row-wise [closed]

Suppose I have a multidimensional list as shown below: RandomInteger[{1,10},{3,7}] I obtain the results: $$ \left( \begin{array}{ccccccc} 3 & 8 ...
0
votes
1answer
44 views

Combining list x-y data with a list of errobars into one list (mathematica-style)

Suppose I have a list of data I can ListPlot: { {x1,y1}, ... } , and a list of y-errorbars: {erry1, erry2, ... } Is there ...
0
votes
1answer
46 views

How to cut elements from set of data based on function restrictions? [duplicate]

For example, say I have a set of data which takes the form list = {{1,2,4,5,3,2},{2,3,4,2,1,6},{2,3,4,5,4,3}} where all of the elements have a length of 6. ...
0
votes
1answer
43 views

Resolving Error: Mathematica evaluation order on Lists

I have a table that is 27 x 27, each entry corresponds to an element from the periodic table. I use the replacement rules in element list to allow me to convert a list of elements into a list of ...
0
votes
1answer
42 views

Testing a certain function over multiple levels

I regularly want to test if a certain function, here foo, gives the expected result when mapping it over n - level - matrices. My naive approach is to write: ...
0
votes
1answer
79 views

Help with DeleteCases [closed]

Trying to delete small elements from a list with copy = DeleteCases[copy, {y_} /; y <= 1500.0 ] but it does not work.
0
votes
1answer
49 views

Generating list of functions from list of expressions

I know how to create a function from concrete expression like Function[{x, y}, x^2 + y^2] But what if I have a list of expressions list1 and I know the set of ...
0
votes
1answer
102 views

Select positive value from a vector

I am wondering how to pick out the positive Omega value from soln, and make these positive values into a row vector. I know how ...
0
votes
1answer
61 views

How to take single item out of List? [duplicate]

I often get Lists that contain a single item, like {name} or {{2,3,4}}. Is there a function ...
0
votes
1answer
83 views
0
votes
1answer
71 views

Sum similar elements [closed]

I am interested in summing elements in a list or sublist that are similar. I want the sublists of my second elements to be added cumulatively only if their first elements are the same. This is my ...
0
votes
1answer
64 views

Sorting a table of vectors with weights [duplicate]

I'm trying to simplify a table, for instance {{1, {4, 2, 0}}, {4, {2, 4, 0}}, {-2, {3, 3, 0}}, {1, {3, 0, 3}}, {-3, {0, 4, 2}}} Here the first column is the ...
0
votes
1answer
109 views

Advice on Gather

Is there a better way to write this gather? I have a list of particles, "particlelist", and a list of particle coordinates, "coordlist" and I want to put all the particles into a 3-dimensional ng x ...
0
votes
1answer
100 views

Index of iteration inside NestList [duplicate]

I have a list of RandomReal: delta = RandomReal[{-0.01, 0.01}, 1000] I want to add each element of the list to the ...
0
votes
2answers
48 views

Filter through list and lump data [duplicate]

I have a very large data set (around 3000) that looks like: ...
0
votes
1answer
91 views

confusion about the use of MapThread and out product

To help distinguish the various dimensions, I have a model which outputs a vector in a series of time intervals, I then construct a list of these models. Next, I would like to compute the outer ...
0
votes
1answer
58 views

Importing and manipulating data in HDF format

I have two matrices A1 and A2 in HDF format. I use the following code to import them. ...
0
votes
1answer
38 views

How do I pull from a data list for parameter values in a system of ODEs and then solve and plot?

I have a parameter set list and I would like to solve a system of ODEs multiple times using each parameter set in the list. Then I would like each set of solutions to be graphed on the same plot. ...
0
votes
1answer
139 views

Generate encoding from nested list

Taking reference of Huffman code algorithm, ...
0
votes
1answer
65 views

Produce a 1-dimensional list of all unique matrix elements

We have some symbolic matrix m, e.g. m={{1, x, 4 x + y},{0, x y + 4x, 4x},{7 x, x, 4x + x y}} and we want to produce as output a list of all the unique elements ...
0
votes
1answer
52 views

Error about limit MaxExtraPrecision

After my evaluations I have an error: N::meprec: Internal precision limit $MaxExtraPrecision=50. reached while evaluating ... ...
0
votes
1answer
70 views

how to filter out numbers of specific type in a table

I am working with a way to generate a table of some numbers, but the one functions could return the complex numbers which I don't want. I am going to filter out the complex numbers. The only way I can ...
0
votes
1answer
77 views

Why Solve won't work for user-defined function, used for system solving? [closed]

I have a list of x-es, that I transform into a list of tx-es. Also tao is my user-defined function that I don't know the parameters of, but I do know the values I get when I put the tx-es in it. And ...
0
votes
2answers
110 views

Delete False values from a list [closed]

I have table: t = {False, False, False, a <= 456, a <=567, a<= 897} I want to delete all values which are 'False' and make my table to looks like: ...
0
votes
1answer
137 views

Interpolation problem on the list

I have a List of Latitude, Longitude and Measurement. a = {{{93, 104}, 290}, {{94, 103}, 292}, {{95, 105}, 291}, {{97, 109}, 294}, {{97, 102}, 295}}; And, I ...
0
votes
1answer
131 views

Adding labels on ArrayPlot and coloring rows

I need to add lables on the right from ArrayPlot for each row and color the black square of each row depending on values from two list. Color list has a numbers in some range and should be mapped ...
0
votes
1answer
286 views

How can I combine several 2D-plots to one big 3D plot?

So I've been able to make a list given by list = Table[{xValues, f[xValues, t (*fixed*)]}, {xValues, xmin, xmax}] For example: ...
0
votes
2answers
82 views

Generate higher dimensional box vectors

I'd like to generate integer vectors in $\{-M,-M+1,\dots,M\}^n$, where $M$ and $n$ are parameters. For a fixed $n$, say $n=3$ for instance, I only know I can use ...
0
votes
1answer
99 views

Generating an array using list values at indices corresponding to entries in a separate list satisfying some criterion

Imagine one has an array of integer value sets that looks like this: ...
0
votes
1answer
120 views

How to simulate a multivariate recursive system from a list

New to mathematica, trying to use Eric Swanson's Pertubation AIM program to solve DSGE models. His code produces a solution as a list or a table. My question is how do I use this list to simulate the ...
0
votes
1answer
74 views

How does PolarPlot render a nested list of functions?

I am getting unexpected plots from PolarPlot when I provide a list of functions that I generate using Table. I suspect the ...
0
votes
1answer
108 views

Displaying Values of Fuction at end of Period by Grid

My intention is to place the values of two function into a small box within my chart. To be more precise I have two vectors. A meanvector which shows the average value of all simulated stochastic ...
0
votes
1answer
194 views

Brownian Motion with stopping threshold

I just want to generate one stochastic process, whereas I want to be able to manipulate the start value and the volatility. Furthermore, the process should stop when it reaches 5 However, as soon as ...
0
votes
1answer
84 views

order items of a table

I am trying to change order of a table. ...