I have this matrix

` B=[-3 4 7;9 11 -13;-17 19 -23;-29 31 37;39 41 47]`

and I need to find the sum of the non perimeter elements using a for loop. I can find the sum of a single column or row or of the whole matrix, but I don't know how to write a loop to only sum the 3 non perimeter numbers. Any help is appreciated, thank you.

## Best Answer