How to return the dimension of image if I had already add padding before ?

W = ones(3);
padded = padarray(W,[1, 1],'symmetric','both');
ASK : dimension = 3x3
after padding = 5x5
can you help me, how to return the dimension back to 3x3

 Accepted Answer

W = W(2:end-1, 2:end-1);

3 Comments

W = W(2:end-1, 2:end-1);
W = 3
sorry but its not dimension 3x3
Sorry. It should read:
W = ones(3);
padded = padarray(W,[1, 1],'symmetric','both');
X = padded(2:end-1, 2:end-1);
size(X)
ans =
3 3

Sign in to comment.

More Answers (0)

Categories

Find more on Simulink in Help Center and File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!