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

4
votes
1answer
77 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
34 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
629 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
78 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
32 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
22 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
229 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
43 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
40 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
203 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
69 views

Color according to condition. [closed]

So, my problem is the following: I have the following table ...
3
votes
3answers
122 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
478 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
59 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
69 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
71 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
70 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
56 views
13
votes
6answers
925 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
50 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
37 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
83 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
52 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
140 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
413 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
57 views

Strange behavior of ParallelTable

I was trying to carry out the following calculations: ...
4
votes
2answers
108 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
77 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
100 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
116 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. ...
2
votes
3answers
55 views

Specify number of elements instead of step in Table [duplicate]

I think I have seen what I was looking for a ong time ago but I can't see nothing such in documentation. Quite often, I would like to create a Table with given ...
4
votes
1answer
143 views

How to increase the evaluation speed of this somewhat complicated table / matrix operation?

I'd like to calculate the following one-dimensional array: OneDimArray = Table[(Norm[Sum[ MatrixA[[i,j]]VectorB[[j]],{j,N}]])^2,{i,N}] However this takes a very ...
1
vote
1answer
196 views

Extracting data from NDSolve result

Normally I wouldn't ask such question before even read the material from the Wolfram Documentation about what I'm trying to do but this time I have a pretty tigh dead end. I apologize for that. So, ...
4
votes
1answer
89 views

How to combine two large tables and export them to .txt file?

I have two large tables. I shall post only 2 rows out of 100+. I shall name the first table blabla and the elements are: ...
1
vote
0answers
46 views

NIntegrate and Part issues [closed]

I'm trying to numerically evaluate an integral. To try and speed up the process, I decided to calculate some values that will be needed in advance using Parallel Tables. This is what I have: ...
3
votes
1answer
63 views

How to fill a tensor with matrices one by one?

I have this tensor: nn = 4; tableToFill = Table[x, {p, 1, nn}, {q, 1, nn}, {i, 1, nn}, {j, 1, nn}]; that I want to fill with a matrix one by one with a matrix ...
3
votes
3answers
177 views

Optimizing a series of basic matrix operations—scaling doesn't seem right with matrix size

I have a simple operation that I'd like to apply to an n×n matrix. My problem (well, one of them...) is that it runs in, say, 4 seconds for a 100×100 matrix, but it took five and a half minutes to run ...
-1
votes
1answer
82 views

Parallelize in Mathematica [duplicate]

Here is two test to understand the parallelize in Mathematica: ...
3
votes
1answer
113 views

Generate a 3D grid data table

I would like to generate a 3D Grid, not for displaying, but to do computations on it, so no draw functions I guess. I have a simple version of what I am thinking, however, it is terribly slow: ...
6
votes
2answers
2k views

How to export results of an analysis in table format into MS word file

I'm working on a simulation study using Mathematica 8. At the end of the analysis I'll have a matrix of data containing my results (assume for three variables like x,y & z). I used these codes for ...
2
votes
5answers
79 views

tabulating summation series with restrictions

Trying to solve this question for a good 5 hours but remained stuck. My intuition tells me I am missing something trivial that I've overlooked or forgotten. I am restricted only to the function 'table'...
0
votes
0answers
49 views

Time needed to solve NIntegrate is much longer than what I was expecting

I'm trying to do the following list: tablevdip = ParallelTable[{x, y, Vdip[x, y, 6]}, {x, -1, 1, .5}, {y, -1, 1, .5}];] with ...
1
vote
0answers
36 views

Defining an object which is function in some variables and tensor in some other indices

I am trying to define an object which function in some variable and tensor in other indices. My attempt at it was: ...
0
votes
0answers
59 views

FindRoot for vectors

My problem is the following: quad = 26; R is a quad x 3 matrix, lpand ...
1
vote
1answer
321 views

How to use Table to assign values to variables in a list?

I'm trying to do the following: R = {a, b, c, d, e, f, g, h, i}; Table[R[[n]] = RandomInteger[{0, 20}], {n, 1, Length[R]}] My intention is to assign a random ...
0
votes
2answers
118 views

How to evaluate function in the grid?

I have a function f[a_, b_]: = b^a + a b. a takes values {1,2,3,4}, and ...
1
vote
2answers
112 views

depicting specific element of a table (knowing its position) in different color

there is some 20 Time 20 tables, in each step we choose one element randomly. how can show this random selected element with different color?
2
votes
1answer
50 views

Add text label in the top-left of a TableForm

I have a function that should give a multiplication table for an integer input: TableForm[Outer[Times, Range[#], Range[#]], TableHeadings -> Automatic]& ...