extract matrix from matrix
Mostra commenti meno recenti
i have matrix of 256*256 n i want to extract first 4*4 matrix of every 8*8 blocks of 256*256 matrix
Risposte (1)
Azzi Abdelmalek
il 28 Mar 2014
Modificato: Azzi Abdelmalek
il 29 Mar 2014
Edit
A=rand(256) % Example
idx=1:8:256
[jj,ii]=meshgrid(idx,idx)
B=cell2mat(arrayfun(@(ii,jj) A(ii:ii+3,jj:jj+3),ii,jj,'un',0))
8 Commenti
Jitesh Bhanushali
il 28 Mar 2014
Azzi Abdelmalek
il 28 Mar 2014
This is another question, please edit your question
Azzi Abdelmalek
il 28 Mar 2014
A=rand(256) % Example
idx=1:8:256
[jj,ii]=meshgrid(idx,idx)
B=arrayfun(@(ii,jj) A(ii:ii+3,jj:jj+3),ii,jj,'un',0)
Jitesh Bhanushali
il 28 Mar 2014
Azzi Abdelmalek
il 28 Mar 2014
B is a cell array containing all 4x4 arrays. Type
celldisp(B)
Jitesh Bhanushali
il 29 Mar 2014
Jitesh Bhanushali
il 29 Mar 2014
Azzi Abdelmalek
il 29 Mar 2014
cell2mat(B)
Categorie
Scopri di più su Resizing and Reshaping Matrices in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!