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

 Akzeptierte Antwort

Thorsten
Thorsten am 15 Dez. 2014
Bearbeitet: Thorsten am 15 Dez. 2014
W = W(2:end-1, 2:end-1);

3 Kommentare

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

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Simulink finden Sie in Hilfe-Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by