How do I make a rectangular mask of 1's?
Show older comments
Hi. I have a matrix of 768x1024. Now, within this matrix, I want to have a rectangle such that it is centered around the middle column of the matrix and has dimension (k)x1024, where k is a variable. This (k)x1024 rectangular portion within the 768x1024 matrix should have all entries 1 and the rest of the matrix entries should all be zero. So, it creates sort of a mask so that when I multiply it with another 768x1024 matrix, the result is only the rectangular part of the other matrix. All help is appreciated. Thanks.
Accepted Answer
More Answers (0)
Categories
Find more on Numerical Integration and Differentiation 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!