Is there a easy way to call on the minor of a matrix?

Given an nxn matrix, I want to call on the n/3Xn/3 (assume n divisible by 3) matrix appearing in the center so that I can change its elements to zeros. For example, if I had a 6x6 matrix A, I would want to change the entries A(15), A(16), A(21), A(22) to zeros.
Mario271Asked:
Who is Participating?
 
Eyal-fConnect With a Mentor Commented:
How about this:

A is your matrix.

k=(n-n/3)/2+1;
A(k:(n-k+1),k:(n-k+1))=0;
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.