Create zeros in matrix size, but not 1. column and row, or last column and row
Show older comments
Hi
I am trying to make a matrix where the middle has to be changed into zeros, f. ex. with magic(4)
v=magic(4)
v(2,2)=0; v(2,3)=0; v(3,2)=0; v(3,3)=0;
16 2 3 13
5 11 10 8
9 7 6 12
4 14 15 1
Here i want the 11, 10, 7 and 6 to be zeros. But need it to be done in random size matrix.
Pretty new in the whole matlab world.
Anyone whom can help?
3 Comments
Azzi Abdelmalek
on 15 Aug 2013
Edited: Azzi Abdelmalek
on 15 Aug 2013
What is the middle of a matrix 9x9?
Andrew Reibold
on 15 Aug 2013
(5,5) seems like it would be the middle of that..
Anders
on 15 Aug 2013
Accepted Answer
More Answers (0)
Categories
Find more on Creating and Concatenating Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!