Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/73.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/matlab/13.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
在R中创建矩阵_R_Matlab - Fatal编程技术网

在R中创建矩阵

在R中创建矩阵,r,matlab,R,Matlab,如何在R中创建此matlab矩阵 ABC = {[1 1 3 ] [4 5 6 ] [1 1 2 ] [1 1 2 ] [1 32 2 ] [2 3 1 ] }; 它是R中的一个数组: 假设我知道你的结构是正确的。我上次接触matlab已经有几十年了。@Matthew_Lundberg,谢谢。我希望这会奏效。

如何在R中创建此matlab矩阵

ABC     =    {[1     1     3  ]   [4      5    6  ]
              [1     1     2  ]   [1      1    2  ]
              [1    32    2   ]   [2      3    1  ] };
它是R中的一个数组:


假设我知道你的结构是正确的。我上次接触matlab已经有几十年了。

@Matthew_Lundberg,谢谢。我希望这会奏效。
ABC <- array(c(1,1,1, 1,1,32, 3,2,2, 4,1,2, 5,1,3, 6,2,1), dim=c(3,3,2))

> ABC
, , 1

     [,1] [,2] [,3]
[1,]    1    1    3
[2,]    1    1    2
[3,]    1   32    2

, , 2

     [,1] [,2] [,3]
[1,]    4    5    6
[2,]    1    1    2
[3,]    2    3    1