I want to overwrite some specific border lines in Matlab, can anyone help ?

1 Ansicht (letzte 30 Tage)
Hello!
I have a situation like this:
And, I want to use the encircled lines for padding so that I can obtain a new situation that looks like this:
Can anyone help me to write a Matlab code that can do this ?
Thank you!

Akzeptierte Antwort

Gobert
Gobert am 7 Jun. 2016
A = magic(4)
B = circshift(A,[1 1])
C = padarray(B(2:end,2:end),[1 1],'replicate','pre')

Weitere Antworten (0)

Kategorien

Mehr zu Migrate GUIDE Apps finden Sie in Help 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