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 vue (au cours des 30 derniers jours)
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),:)];

Réponse acceptée

DGM
DGM le 22 Avr 2021
Modifié(e) : DGM le 22 Avr 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]));

Plus de réponses (0)

Catégories

En savoir plus sur Loops and Conditional Statements dans Help Center et File Exchange

Tags

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by