Inverting each Submatrix of a Matrix

Hi
I have a matrix that is used to record submatrices, which are 2x2.
[A B C]
[D E F]
[G H I]
all are 2x2 and all these submatrices have to be inversed. I do not want to use for loop. Is there any way to do this efficiently?
Thanks

2 Comments

Do you have a cell array?
I do not use cells

Sign in to comment.

Answers (1)

If you have the image processing toolbox
im=randi(10,4)
out=blockproc(im,[2 2],@(x) inv(x.data))

1 Comment

Thanks for your reply, but when I run profiler, for loop seems to be more efficient.

Sign in to comment.

Categories

Find more on Programming in Help Center and File Exchange

Products

Asked:

on 27 Jun 2014

Commented:

on 27 Jun 2014

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!