Questions on the use of the Table[] command and other functionality related to lists. Use [tag:matrix] for matrix algebra and related methods, and [tag:list-manipulation] for questions about transforming or operating on existing lists.

learn more… | top users | synonyms

0
votes
1answer
98 views

ParametricPlot3D crashes Kernel when called repeatedly in loop

I have a parametric function surf[u,v]. It can be plotted successfully like this: ...
0
votes
1answer
41 views

How to write a similar “for loop” with table?

I have a code to replace the z coordinate of one point A(x,y,0) on the xy plane: ...
1
vote
1answer
58 views

Deleting vertices from Graph and preserving Structure?

My goal is to remove vertices from graphs (and the edges from them) and then take GraphComplement to find out cut sets in graphs with sink and source such as here. So How can I delete vertices from a ...
0
votes
4answers
53 views

Matching a Table and a List and building a new Table

I have a Table which includes {Numbers, Probabilities}. For example A= {{1,0.5},{2,0.25}, {3,0.1},{4,0.9}……{100,0.1}}. Put attention that the numbers are 1,2….100 in order. I have a List of random ...
3
votes
4answers
122 views

Find the length of the intersection of two lists including duplicates

I have 2 Lists. The first one includes all the numbers from 1 to 10. listA={1,2,3,4,5,6,7,8,9,10} The second includes ...
3
votes
3answers
175 views

Drop in nested tables?

I want to drop a specified number of elements from a 'table ...
2
votes
1answer
70 views

issue with Animate

I want to make a animation based on the dataset like data = Flatten[Table[{x, y, x^2 - y^2}, {x, -3, 3}, {y, -3, 3}], 1]; I show this data using a ListPlot3D. ...
4
votes
3answers
117 views

Alternative forms to Table for iterating over replacement rules

I have a multivariate polynomial x. I get coefficients of various monomials using CoefficientRules, which returns a list of ...
2
votes
0answers
47 views

Export a plot to Excel [closed]

I know questions similar to this have been asked before but I couldn't figure it out. These are my hypothetical lines: ...
0
votes
1answer
51 views

What makes imaginary parts show up?

If I define a function using alpha[y_, d_] := 2 ArcCos[1 - (2 y)/d] Then if $y$ and $d$ are equal, the result is $2\pi$ : ...
0
votes
0answers
22 views

How to extract limits number of control points out of an equation

I am working on generating a table of control points: Table[x^2 + y^2 + z^2 == 1, {x, -2, 2}, {y, -2, 2}, {z, 2, -2}] I am getting a whole bunch of points but I ...
0
votes
1answer
63 views

Function Evaluation in Table [closed]

Apologies in advance: this is a really basic question, and I am sure it has been answered, but I don't know enough mathematica to even find the answer. I have a differential equation I want to ...
-2
votes
1answer
59 views

Multiple Sets of Data

I would like to plot multiple sets of x and y data on the same plot with a legend. This is the code I am using right now: ...
2
votes
1answer
68 views

How to determine $n$ values of Abs[2^n - 51] is a prime number? [closed]

Suppose that it is required to find the values of $n$ such that Abs[2^n - 51] is a prime number. It is easy to determine that the first few values are ...
0
votes
1answer
51 views

Append[] is not working for empty list [duplicate]

I am trying to create an empty list and add an element but the list is not being populated. My code ...
0
votes
1answer
113 views

loops and data file

I have solved a set of equations for a specific given data point and restricted my solutions to 100. then I did TrimmedMean to have the mean value of all 100 ...
0
votes
0answers
50 views

Making Multiple Curves with ListLinePlot for Fixed Increments

I want to make a plot with, multiple curves, for fixed values of inc : where my x values are (c1+c2)/2) and my ...
2
votes
1answer
49 views

Proper use of TableAlignment

At various times though use of extensive trial-and-error I have gotten results I want out of TableHeadings. More often I give up. For example, given two columns, (a) how does one make the first ...
1
vote
0answers
23 views

How do I add a finite value to one component of a set of vectors [closed]

I have a set of (x,y) values in some *.csv file, when I open them with Mathematica to plot it some of the plots are shifted so I need to add some finite value to one of the components of every vector. ...
4
votes
1answer
73 views

Joining table of tuples with table of scalar values [closed]

I have a table of dimension $M \times N \times Q$ of 3-tuples {x,y,z} that represent points, and another table of dimension $M \times N \times Q$ of scalar values. ...
0
votes
0answers
33 views

How to output values created by a nested for loop into table/ matrix form

I have successfully created the values i want, however i need to form them into a table. I need to create this table one row at a time, so the first 24 values would be the the first row, values 25-49 ...
12
votes
7answers
624 views

How to properly inject iterators into table? [duplicate]

Goofing off on a prior question, I was fiddling with other methods, which led me to the need to inject a constructed set of iterators into a table construct. Now, ...
16
votes
16answers
2k views

Generating a list of numbers that are not multiples of 4

I want to write simple code that will list all numbers from $1$ to $n$ that are not multiples of $4$. And in this case I consider that ...
1
vote
1answer
72 views

Plotting a table with varying step sizes

how can I plot the below green curve? Is there any way I could manipulate the step sizes? This is my current code: ...
1
vote
0answers
31 views

How Can I combine the equations' results in a table without “x->” [closed]

For example: I have a series of functions: F[x_,o_]=x+o And I want to combine the result into a table with o=0.3,0.6,0.9.. ...
0
votes
1answer
21 views

Define nonzero variables Varyx = z_xy from table with dimensions x,y and values z_xy

I'm trying to do the following. I have a table, call it TransTable. To give an example ...
4
votes
2answers
217 views

Mysterious behaviour of ParallelTable

This question is related to Export bug in combination with ParallelTable?. The following code shows an even stranger bug than in the upper question. The y-axis should always be logarithmic, but in ...
3
votes
1answer
40 views

Table headings for a single column of data?

Is there a way to get this to work? data = {2, 1, 4, 3}; TableForm[ data, TableHeadings -> { {"L1", "L2", "L3", "L4"}, {"data"} } ]
0
votes
1answer
39 views

reducing decimal places in a table

How can I reduce the number of decimal places within a table to let's say two digits? The default setting is 6 decimal places. this is the mathematcia code: ...
8
votes
1answer
191 views

Export bug in combination with ParallelTable?

I am programming with Mathematica 10.3.1.0 on Windows 10 Professional 64 Bit and have an i7-4940-MX 3,1 GHz processor (4 cores). When I use in the example code below ...
0
votes
2answers
64 views

Color according to condition. [closed]

So, my problem is the following: I have the following table ...
3
votes
3answers
117 views

How to substitute Table environments by a more sophisticated code

I often use Tables inside of Tables to fill 2 dimensional arrays. Is it possible for the lower example code to substitute the Table environments by a more sophisticated and shorter code? ...
6
votes
4answers
477 views

A fast way to compute arrays avoiding If or Which

I found out that if I have to calculate huge arrays with most of the elements being zero( let's say each row has 10000 elements and only 8 are non zero) and the non zero elements' positions being ...
0
votes
1answer
46 views

Combining first 5 columns from CSV file into AbsoluteTime date

Thanks in advance for all your help. I need to import data from a CSV file that looks like : (easier to read in excel) I would like to convert the data into timestamps by creating a Table with 2 ...
1
vote
2answers
54 views

Export NDSolve data

I have calculated a solution of a system of differential equations using NDSolve and generated a plot. How could I extract the data of the solutions? The input is ...
1
vote
1answer
61 views

First come, first save in ParallelTable parallelization

Short version of the question: In C++'s OpenMP, I know how to get what I want, but I'm wondering whether Mathematica has the same option. It's called "dynamic scheduling" when parallelizing. Long ...
3
votes
1answer
65 views

Similar Table commands differ greatly in run time

With version 10.3.1 for Microsoft Windows (64-bit), the similar codes ...
1
vote
0answers
55 views
13
votes
6answers
900 views

Calling Table with custom iterator

I often find myself in situations where I, for example, need to build a table for some expression, but want to set the number of points rather then the step size, so the code ends up looking like this ...
0
votes
1answer
45 views

Grid with recurrence relation terms

I want to get the recurrence relation for several values of n in a grid form. At the moment I am using ...
1
vote
1answer
35 views

Access variable middle of the run [duplicate]

I execute a Table[] that need large time to be finished. If I abort it I loose what evaluated until now. Does it possible to stop running and save what evaluated ...
3
votes
2answers
76 views

Table of Buttons [duplicate]

What's the correct way to form a table of buttons in which each action depends on the index in the table? E.g., I want to get {Button[1,f[1]],Button[2,f[2]]} ...
2
votes
0answers
49 views

Transposing a table [closed]

I created this table so that it is a collection of 5 different functions that I need. It outputs the values that I want, however, I cannot figure out how to get the orientation right. I would like to ...
-1
votes
1answer
138 views

A pointer to the array in p1=Table in Table =p0 Eror [closed]

There is a circle of 10 points. How to draw another circle around this point from the first array? And so it drags along in the first circle. As in the program, drag the red. The coordinates of the ...
1
vote
1answer
389 views

Factor vector out of a matrix

I am wondering how to factor a[1],a[2],...,a[4] out of sim so that I can write sim as the ...
0
votes
1answer
55 views

Strange behavior of ParallelTable

I was trying to carry out the following calculations: ...
4
votes
2answers
86 views

Finding the smallest starting number producing a Collatz sequence of length 125 which ends with a value > 4

I'm supposed to do a Mathematica function that selects the smallest number not less or equal to 4 after 125 iterations. I am not good at coding, so some help/advice would be awesome. My code so far. ...
2
votes
2answers
76 views

Multiplying a table with constants

I have a table with coordinates {{x1,y1},{x2,y2}} that I want to multiply with a separate constant for x and one for y so: ...
2
votes
0answers
91 views

Fast construction and reshaping of large tensors

I'm trying to construct a large matrix which is derived from some higher rank tensor (the rank of interest to me changes case by case, so it needs to be a general method). Currently, the process of ...
2
votes
2answers
109 views

How can I increase the precision of my table?

I want to see first 15 digits for the values in the table computed below. ...