Created
July 17, 2014 11:38
-
-
Save bmiles/ab3804be20d22e66a93e to your computer and use it in GitHub Desktop.
rebinning a matrix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
b = a; #original image | |
[L W] = size(a); % get dimensions of matrix | |
% define bin factor | |
BinW = 8; | |
BinL = 8; | |
% chaning the size of matrix b, to binL by ?? then adding 1 | |
b=sum(reshape(b,BinL,[]) ,1 ); | |
% changing the size of the matrix b to be binned length by ?? then (.')? | |
b=reshape(b,L/BinL,[]).'; | |
b=sum( reshape(b,BinW,[]) ,1); | |
b=reshape(b,W/BinW,[]).'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Unsure of the meaning of
and