arrays - reshape 和重新排列数组

标签 arrays matlab reshape

我有一个大数组,看起来像这样:

1
4
5
3
6
2
7
4
3

我想重新排列这个数组,它看起来像这样:

7 4 3
3 6 2
1 4 5

我的原始数组大小为 13700x1,所以我无法手动完成,如果我使用 reshape 函数,数组的形状会错误:

1 3 7
4 6 4
5 2 3

我希望我的意图是明确的。谢谢!

最佳答案

尝试

tmpArray = [1
4
5
3
6
2
7
4
3]

flipud(reshape(tmpArray, 3, 3).')

关于arrays - reshape 和重新排列数组,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36996129/

相关文章:

javascript - 如何在没有运算符的情况下将 lodash _ 与数组而不是多个参数一起使用

R对数据表的特殊 reshape

arrays - MATLAB:将 N x 4 数组置换并 reshape 为 2 x 2 x N 数组

JavaScript/React 根据第一个字段自动填充其他字段

java - 基于父数组对字符串数组进行排序?

Python 多进程 - 索引多个返回

matlab - 在 matlab 中更改过滤器(B,A,X)并出现内存不足错误

matlab - 如何保护 MATLAB 编译的应用程序不被分发?

matlab - 在 MATLAB 中执行 imwrite 后像素值发生变化

python - Keras/Tensorflow 预测 : error in array shape