Sounds simple but I am finding it little difficult to comprehend.
Thanks.
Try this:
clc;
close all;
% Create some arbitrary array for demo.
imageArray = magic(5)
[rows cols] = size(imageArray);
% Create a mask array the same size that is all 1's.
maskArray = ones(rows, cols);
% Zero out the corners.
maskArray(1, 1) = 0;
maskArray(1, cols) = 0;
maskArray(rows, 1) = 0;
maskArray(rows, cols) = 0
% Dot-multiply to mask the image.
maskedImageArray = imageArray .* maskArray
I'd be tempted to use sub2ind() to shorten that code.
maskArray = ones(rows, cols);
maskArray(sub2ind([rows, cols], [1 1 rows rows], [1 cols 1 cols])) = 0;
"Image Analyst" <imagea...@mailinator.com> wrote in message <gqbb4e$8an$1...@fred.mathworks.com>...
clc;
close all;
% Create some arbitrary array for demo.
imageArray = magic(8)
[rows cols] = size(imageArray);
% Create a mask array the same size that is all 1's.
maskArray = ones(rows, cols);
% Zero out the corners in a 2x2 submatrix at each corner.
submatrixSize = 2;
maskArray(1:submatrixSize, 1:submatrixSize) = 0;
maskArray(1:submatrixSize, (cols - submatrixSize + 1):cols) = 0;
maskArray((rows - submatrixSize + 1):rows, 1:submatrixSize) = 0;
maskArray((rows - submatrixSize + 1):rows, (cols - submatrixSize + 1):cols) = 0
Thanks once again, I learned something new today.
"Image Analyst" <imagea...@mailinator.com> wrote in message <gqbdl1$bn1$1...@fred.mathworks.com>...