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

 Réponse acceptée

Thorsten
Thorsten le 15 Déc 2014
Modifié(e) : Thorsten le 15 Déc 2014
W = W(2:end-1, 2:end-1);

3 commentaires

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
Thank u Thorsten. its work

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Simulink dans Centre d'aide et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by