![](/img/trans.png)
[英]Get Matrix 2D from Matrix 3D with a given choice of the third dimension corresponding to the first dimension
[英]Is it possible to increase the dimension from 2D to 3D?
假设我有一个向量[1,10],如何将维数增加到三维矩阵。 我想要的是让A(:,:,1)= [1,10]这样size(A)= [1,2,1]。 我知道可以使用重塑/置换,但是A的大小始终为[1,2]。
由size函数size(A)
返回的输出中的元素数将始终为2或最大维数大于1(以最高者为准)。 这是因为在未指定的尺寸的所有尺寸可以(从数学上讲)被看作是1。这也是为什么size(A,17)
将返回1
和为什么A(1,2)
是相同的A(1,2,1,1,1,1,1,1)
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.