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

2
votes
3answers
125 views

Table with condition

I have 2 lists of numbers A = Range[16, 65] and B = Range[10, 16]. I want to form all possible combinations $(a,b)$ of the ...
0
votes
0answers
35 views

3D listplot, for a given table

I have a table of 4 data, my first problem is how can I choose one region in which just one of these variables is constant and the listplot3D the other 3 variables? I need to do this for at several ...
2
votes
3answers
75 views

Getting directly a packed array of repeated packed arrays

Consider this code: Needs["Developer`"]; N@Range[5]; PackedArrayQ@% Table[%%, 5]; PackedArrayQ@% which prints True, ...
3
votes
2answers
147 views

Deleting vertices from a 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. ...
0
votes
1answer
65 views

How to animate ListPointPlot3D from table?

I have a text file which is the following format: 1159, 2209, 19, 141 2169, 1827, 23, 54 Which I import, sort and gather using: ...
1
vote
2answers
66 views

fill in a table with some words letters

I have a list of words list={"ingenuous", "forgotten", "tree", "supercomput", "hundred"} How can I put the letters of each word in an element of a table such as ...
1
vote
1answer
61 views

How to convert a Number to String for Export a Table

I am generating a table with 4 columns, wheras only the columns 3 and 4 have the same length. ...
-7
votes
1answer
82 views

efficient writing, matlab vs mathematica [closed]

I would like to implement in mathematica, this simple matlab loop: c(1)=5; for i=2:10 c(i,:)=c0*i; end The point is that pos has an initial value and updates ...
0
votes
0answers
37 views

Fast way to export large amount of data in “Table” format

I have about a million 3D points, say data = Table[{1. x, 1. y, 0.}, {x, 1000}, {y, 10^3}]~Flatten~1; I want to visualize them, but ...
0
votes
1answer
35 views

Control output in mathematica

I'm producing a set of coordinates for every iteration in a simulation and saving it into a txt file in the following way: ...
0
votes
1answer
129 views

ParametricPlot3D crashes Kernel when called repeatedly in loop

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

Size of headings for a table with graphs

I want to change the size of the heading of a table that includes graphs and am having no luck. The command I am currently using is ...
3
votes
3answers
124 views
1
vote
1answer
60 views

Create a table indexed form a list giving a the index specifications

I need to create a table indexed form a list. e.g.: list={{i, 3}, {j, 4}}; would give the table Table[..., {i,3}, {j,4}]; ...
6
votes
1answer
153 views

Smoothing out data points in a ListDensityPlot

I stumbled upon this problem when I was trying to make some nice smooth ListDensityPlots of my numerical data. In short, my problem is that I let Mathematica plot two copies of basically the exact ...
1
vote
1answer
68 views

Export Table to Quicktime MOV Animation

I'm tying to export a table of images to a quicktime movie with a set duration (in this example, 12.67 seconds) ...
1
vote
0answers
78 views

Speed differences between Table, Replace, Array, Map, and AssociationMap

EDIT: Actually, it looks like part of this is bogus—Array doesn't actually work on this input (I'm often a little shaky on what kind of input, exactly, works for ...
4
votes
1answer
63 views

RegionPlot error

I'm trying to represent the following table using the command regionplot. The rectangle (0,0), (0.5,0), (0,1),(0.5,1) should be covered, however it is not. Does anyone know what the problem is? Thank ...
3
votes
1answer
93 views

remove unevaluated cells from table

I have created a table Tv where each row is of the form {x, y, Iv[x,y]} where Iv is some complicated numerical integral and <...
0
votes
1answer
148 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
1answer
22 views

Dynamically constructing symbolic tensors

Is there any way to construct tensor of any given dimension d and rank r with symbolic entries? i.e., instead of manually constructing one as Table[T[i,j,k],{i,1,10},{i,1,10},{i,1,10}] for d=3 and r=...
11
votes
2answers
164 views

How to correctly implement in a new function the scoping behavior of Table, Sum and other commands that use Block to localize iterators?

It is documented that "Block is automatically used to localize values of iterators in iteration constructs such as Do, Sum, and Table." Therefore the dummy index (iterator) in a Sum is shielded ...
3
votes
1answer
53 views

Constructing tensors with arbitrary rank and dimension [closed]

How can I create a tensor with arbitrary rank n and m components in each dimension? I am looking for a command in which I insert n and m and it spits out the corresponding tensor with random entries (...
0
votes
1answer
44 views

Evaluating Root forms in a Table [closed]

When I put a Root form in table, the parameters of the Root form don't evaluate. I don't know how I can indexed values substituted into root form in the table to get have numeric output. ...
0
votes
0answers
52 views

Use If condition with ListPlot

Here is my code to use If condition with PLot: ...
2
votes
1answer
70 views

Operations on dynamic arrays [duplicate]

When I do a simple operation like this fib = Table[Fibonacci[i], {i, 15}] and then look to find the position of a certain value, everything works fine: ...
2
votes
4answers
138 views

Table and IF statement

I want to make a table to get a nbyn matrix. However, the diagonal are divided by zero. For example: n = 5; Table[1/(Sin[i] - Sin[j]), {i, 1., n}, {j, 1, n}] I ...
3
votes
1answer
126 views

Plotting a table with many y values

I'm trying to plot a bifurcation map for a Lorenz System. I have a function (called estables in the code that follows) which, for a certain value r, returns the ...
1
vote
1answer
56 views

How can use Table for two functions obtained from NDSolve? [closed]

I have obtained a numerical solution using NDSolve for two functions a(x) and b(x). how do I use Table to make a list of a(x) vs b(x) values. is it simply Table[{a(x),b(x)},{x,0,100}] or should I use ...
3
votes
1answer
81 views

Table with programmatically specified number of iterators in Compile

Compare two ways of computing a table of values of a multivariable Gaussian: ...
0
votes
1answer
92 views

Accessing the elements in a table is slower than calculating each time?

This is a follow-up of How to accelerate combinations and sum calculations here? I have tried all tricks but when N reaches 35 the time is still intimidating in a 16-core server, which is far better ...
1
vote
2answers
499 views

What is the best way to export a table of numerics with legends ready for Word?

I want to put my table output into an MS Word document without having to edit it in word after, so I want to export it ready for Word in final version with complete legends and title. Is it possible ...
6
votes
1answer
128 views

Why does Table behave differently in Mathematica compared to WolframCloud?

In Stephen Wolfram's elementary introduction to the wolfram language it says you can use the table function like this: Table[5, 10], to create a table of the ...
1
vote
0answers
27 views
0
votes
1answer
48 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: ...
0
votes
4answers
63 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
140 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
180 views

Drop in nested tables?

I want to drop a specified number of elements from a 'table ...
2
votes
1answer
77 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
137 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
55 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
53 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
71 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 solve....
-2
votes
1answer
61 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
70 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 $\{2,3,5,6,......
0
votes
1answer
66 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
0answers
56 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
55 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 left-...
1
vote
0answers
24 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. ...