Info
此问题已关闭。 请重新打开它进行编辑或回答。
Extracting parts of matrix for sub matrices
1 次查看(过去 30 天)
显示 更早的评论
I have 128 by 128 matrix. I want to extract 16 by 16 matrices from seperately.
it sould be like 1-16 colums with 1-16 rows and then 1-16 columns with 17-32 rows and so on for all 128 by 128 matrix. (using a loop)
i was thinking of a loop to get this done
k=15;
for i = 1:16:128
for j= 1:16:128
newsubMat = myMat(i:i+k,j:j+k);
UnifomityCalc = (max(max(newsubMat)))/(min(min(newsubMat))); % calculation for uniformity
newsubMat_UniformityVector(i,j) = UnifomityCalc; %trying to saving it for 8 by 8 matrix
Can you please help me with this?
0 个评论
回答(1 个)
James Tursa
2020-4-6
E.g., to put them into a cell array
mat = your matrix
result = mat2cell(mat,repmat(16,8,1),repmat(16,8,1));
1 个评论
此问题已关闭。
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!