A=rand(20,20,10);
[height,width,n]=size(A);
n_train=n;
m=4;
b_width=height*width/m;
b_height=m;
b_train=zeros(b_height,b_width,n_train);
for k=1:n_train
    %B=mat2cell(A,ones(50/10,1)*10,ones(40/10,1)*10);
    B=mat2cell(A(:,:,k),ones(20/10,1)*10,ones(20/10,1)*10);
   temp=[];
   for i=1:2
      for j=1:2
         b_train_vetor=reshape(B{i,j}',1,b_width);
         temp=[temp;b_train_vetor]; 
      end 
   end
   b_train(:,:,k)=temp;
end



分块矩阵转化成向量后合并
A_matrix.png



分块矩阵转化成向量后合并
b_train__matrix.png

相关文章:

  • 2021-12-27
  • 2021-11-30
  • 2022-02-18
  • 2022-12-23
  • 2022-12-23
  • 2021-06-28
  • 2021-12-16
  • 2021-12-31
猜你喜欢
  • 2022-12-23
  • 2021-09-28
  • 2021-12-31
  • 2021-11-21
  • 2022-12-23
  • 2021-10-02
  • 2021-09-02
相关资源
相似解决方案