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 view (last 30 days)
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),:)];

Accepted Answer

DGM
DGM on 22 Apr 2021
Edited: DGM on 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]));

More Answers (0)

Categories

Find more on Loops and Conditional Statements in Help Center and File Exchange

Tags

Products

Community Treasure Hunt

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

Start Hunting!