Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function currMax = findBlockDynamic(A)
- [numR numC] = size(A);
- L = zeros(size(A));
- H = zeros(size(A));
- for row = numR : -1 : 1
- for col = numC : -1 : 1
- if A(row,col) == 0
- continue;
- elseif col == numC
- L(row,col) = 1;
- else
- L(row,col) = L(row,col+1) + 1;
- end
- end
- end
- for col = numC : -1 : 1
- for row = numR : -1 : 1
- if A(row,col) == 0
- continue;
- elseif row == numR
- H(row,col) = 1;
- else
- H(row,col) = H(row+1,col) + 1;
- end
- end
- end
- currMax = max(max(L.*H));
- end
Add Comment
Please, Sign In to add comment