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 次查看(过去 30 天)
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),:)];

采纳的回答

DGM
DGM 2021-4-22
编辑:DGM 2021-4-22
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]));

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Loops and Conditional Statements 的更多信息

标签

产品

Community Treasure Hunt

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

Start Hunting!

Translated by