当前位置: 代码迷 >> 综合 >> reshape(A,a,b)生成目标矩阵
  详细解决方案

reshape(A,a,b)生成目标矩阵

热度:72   发布时间:2023-12-12 06:45:27.0
%A=[1,2,3,4,5;10,9,8,7,6;11,12,13,14,15;16,17,18,19,20;21,22,23,24,25];
a = [1:5 10:-1:6];
b = 11:25;
A = [reshape(a,5,2)'; reshape(b,5,3)']
B=reshape(A,5,5);
C=B([2],[2,3]);
D=B([2,3,4],[4]);
E=B([4,5],[1,2,3]);