To add rows and columns in the start and at the end for a matrix

Dear Researchers,
I need guidance to add rows and columns of ones/zeros in a marix.
i.e matrix should be 13642 * 25295, and matrix I obtained after some processing is now 12251 * 25293.
Now, I need to add lets suppose half of missing rows in start and half missing rows at the end, the same for columns.
Please guide me in this context, your suggestions will be highly appreciated. Looking forward to receive comments on it.

 Akzeptierte Antwort

Matt J
Matt J am 10 Okt. 2021

0 Stimmen

3 Kommentare

Thanks for suggestion dear @Matt J no doubt padd array helps to add rows and columns.
'padarry' has following distributions namely, pre, post or sysmmetical.
how add to non-symetrical number (of ones) of rows/columns ? i.e., 1340 rows before/start and 51 row at the end?
Please guide me in this case. Many thanks I solely appreciate your suggestion.
Looking forward
Just call it twice, one with "pre" and once with "post, each with the respective amount of padding required.
Yeah, i got the spectrum, thanks a lot for your kind suggestions. it helps.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Loops and Conditional Statements finden Sie in Hilfe-Center und File Exchange

Produkte

Version

R2015a

Community Treasure Hunt

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

Start Hunting!

Translated by