Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/76.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Wolfram mathematica 从两个文件导入创建表_Wolfram Mathematica - Fatal编程技术网

Wolfram mathematica 从两个文件导入创建表

Wolfram mathematica 从两个文件导入创建表,wolfram-mathematica,Wolfram Mathematica,我刚开始使用Wolfram Mathematica。 我有两个带数字的文件: x=Import["c"\.path here..\x.txt","Table"]; y=Import["c"\.path here..\y.txt","Table"]; 现在我有两张桌子x和y。我想合并,然后有一张桌子 {{x1,y1},{x2,y2},{x3,y3},{x4,y4} 我可以使用ListPlot构建图形。 我试过用类似的东西 num={}; l1=length[x]; l2=length[y];

我刚开始使用Wolfram Mathematica。
我有两个带数字的文件:

x=Import["c"\.path here..\x.txt","Table"];
y=Import["c"\.path here..\y.txt","Table"];
现在我有两张桌子x和y。我想合并,然后有一张桌子

{{x1,y1},{x2,y2},{x3,y3},{x4,y4}

我可以使用
ListPlot
构建图形。 我试过用类似的东西

num={};


l1=length[x]; l2=length[y]; 
Do[num=Append[num,Partition[x[[i]],1]],Append[num,Partition[y[[i]],1]],{i,l1}]
那我该怎么做呢

我找到了答案

t=MapThread[List,{x,y}]

它简单、短

短,在我的机器上比:


答案在速度上没有差别。

甚至更短的
转置[{x,y}]
t = Thread[{x, y}]