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 Center および File ExchangeLoops and Conditional Statements についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by