extract matrix from matrix
古いコメントを表示
i have matrix of 256*256 n i want to extract first 4*4 matrix of every 8*8 blocks of 256*256 matrix
回答 (1 件)
Azzi Abdelmalek
2014 年 3 月 28 日
編集済み: Azzi Abdelmalek
2014 年 3 月 29 日
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 件のコメント
Jitesh Bhanushali
2014 年 3 月 28 日
Azzi Abdelmalek
2014 年 3 月 28 日
This is another question, please edit your question
Azzi Abdelmalek
2014 年 3 月 28 日
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
2014 年 3 月 28 日
Azzi Abdelmalek
2014 年 3 月 28 日
B is a cell array containing all 4x4 arrays. Type
celldisp(B)
Jitesh Bhanushali
2014 年 3 月 29 日
Jitesh Bhanushali
2014 年 3 月 29 日
Azzi Abdelmalek
2014 年 3 月 29 日
cell2mat(B)
カテゴリ
ヘルプ センター および File Exchange で Resizing and Reshaping Matrices についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!