I have a matrix W of 361*285.I want to create a matrix such that each column(1*285) of the matrix is reshaped into a matrix of (19*19)(read as atom)such that the atoms are concatenated into a 19*15 matrix
조회 수: 1 (최근 30일)
이전 댓글 표시
채택된 답변
KL
2017년 9월 11일
A = rand(361,285);
B = reshape(A,19,19,19,15);
댓글 수: 3
KL
2017년 9월 12일
편집: KL
2017년 9월 12일
You could index B depending on your needs. For example,
>> B(:,:,1,1)
would be 19x19 matrix (this is your atom I guess). There are 19x15 such atoms (from B(:,:,1,1) to B(:,:,19,15)).
Next, I don't understand what you mean by multiply 20x50 matrix to B? As I explained before, you should treat ND-matrix as a matrix of matrices.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!