对 Mathematica 和 Grid 中的表格进行编号
我是 Mathematica 的新手。我会尽力写得有效。
我有两个问题:
Q1: 我有三个表,它们给我的值为 {x1,y1,z1} ,{x2,y2,z2} ...代码如下:
Table[Table[Table[ {xcord, ycord, zcord},
{xcord, 0, 50, 5}],
{ycord, 0, 50,5}],
{zcord, 50, 150, 10}]
现在我需要这样的输出
{1,x1,y1,z1}
{2,x2,y2,z2}
{3,x3,y3,z3}
.
.
{n,xn,yn,zn}
这有两个问题。
首先,我得到的结果格式类似于 {x1,y1,z1},{x2,y2,z2} .... {xn,yn,zn},但我希望它的格式如下:
{x1,y1,z1}
{x2,y2,z2}
{x3,y3,z3}
.
.
{xn,yn,zn}
其次,我无法对每组元素进行编号,在每组元素前面添加数字,就像
{1,x1,y1,z1}
{2,x2,y2,z2}
{3,x3,y3,z3}
.
.
{n,xn,yn,zn}
我尝试为每组坐标制作单独的表格,并对与每组坐标相对应的这些进行编号。然后我尝试将它们放在单独的列中并将它们连接起来,但仍然没有成功。
第二季度: 我想将从上表中获得的值分离到如下所示的网格系统中。就像我们在 Excel 中所做的那样,所有值都驻留在单独的单元格中。
Number X values Y Values Z values
1 x1 y1 z1
2 x2 y2 z2
.
.
n xn yn zn
I am new to Mathematica. I will try to do my best to write it effectively.
I have two questions:
Q1:
I have three tables which give me values as {x1,y1,z1} ,{x2,y2,z2}...The code is given below:
Table[Table[Table[ {xcord, ycord, zcord},
{xcord, 0, 50, 5}],
{ycord, 0, 50,5}],
{zcord, 50, 150, 10}]
Now I need an output like this
{1,x1,y1,z1}
{2,x2,y2,z2}
{3,x3,y3,z3}
.
.
{n,xn,yn,zn}
There are two problems with this.
First, I get my results formatted as something like this {x1,y1,z1},{x2,y2,z2} .... {xn,yn,zn}, but I want it formatted in this way:
{x1,y1,z1}
{x2,y2,z2}
{x3,y3,z3}
.
.
{xn,yn,zn}
Second, I can't number each set of elements adding the numbers in front of each set of elements like
{1,x1,y1,z1}
{2,x2,y2,z2}
{3,x3,y3,z3}
.
.
{n,xn,yn,zn}
I tried to make separate tables for each set of co-ordinates and number these corresponding to each set of the co-ordinates. Then I tried to get each of them in separate columns and join them but still I haven't been successful.
Q2:
I would like to separate the values obtained from the tables above into a grid system like the one below. Something like how we all do in Excel where all values reside in a separate cells.
Number X values Y Values Z values
1 x1 y1 z1
2 x2 y2 z2
.
.
n xn yn zn
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
也许这就是您正在寻找的。
元素编号通过两种替代方法相加,给出 c 和 d。
c==d?真
数 X 值 Y 值 Z 值
1 0 0 50
2 5 0 50
3 10 0 50
4 15 0 50
5 20 0 50
。 。 。 。
Perhaps this is what you are looking for.
The element numbers are added by two alternative methods, giving c and d.
c==d? True
Number X Values Y Values Z Values
1 0 0 50
2 5 0 50
3 10 0 50
4 15 0 50
5 20 0 50
. . . .
也许:
Perhaps: