使用reshap()函数
reshap
clc;
clear;
close all;
a=[1,2,3,5,6,65,786,89];
b=reshape(a,2,4)
a =
1 2 3 5 6 65 786 89
b =
1 3 6 786
2 5 65 89
注意:reshape是对于原数组按照列优先进行抽取,抽取的元素也是按照列先进行排列
使用reshap()函数
reshap
clc;
clear;
close all;
a=[1,2,3,5,6,65,786,89];
b=reshape(a,2,4)
a =
1 2 3 5 6 65 786 89
b =
1 3 6 786
2 5 65 89
注意:reshape是对于原数组按照列优先进行抽取,抽取的元素也是按照列先进行排列