Loop that pads at the top of the sinogram with 100 copies of its top row and at the bottom with 100 copies of its bottom row

1 visualizzazione (ultimi 30 giorni)
How would I create a Loop from this script that pads at the top of the sinogram with 100 copies of its top row and at the bottom with 100 copies of its bottom row.
Proj_sino1024_ROIpadded=[proj_sino1024_ROI(1,:); proj_sino1024_ROI];
Proj_sino1024_ROIpadded=[proj_sino1024_ROI; proj_sino1024_ROI(size(proj_sino1024_ROI,1),:)];

Risposta accettata

DGM
DGM il 22 Apr 2021
Modificato: DGM il 22 Apr 2021
Don't use a loop. If you have IPT, just do this:
outpict=padarray(inpict,100,'replicate','both');
If you don't have IPT, you can do
outpict=cat(1,repmat(inpict(1,:),[100 1]),inpict,repmat(inpict(end,:),[100 1]));

Più risposte (0)

Categorie

Scopri di più su Loops and Conditional Statements in Help Center e File Exchange

Tag

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by