Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

How to put a 3D element in every place of a 3D matrix?

조회 수: 1 (최근 30일)
JAI PRAKASH
JAI PRAKASH 2018년 8월 2일
마감: MATLAB Answer Bot 2021년 8월 20일
How can I perform this?
im1(1:10, 1:10, :) = im2(1, 1, :);
RHS is a 3D element, basically RGB.
It can be done by:
zoomIm(1:10, 1:10, 1) = im(1, 1, 1);
zoomIm(1:10, 1:10, 2) = im(1, 1, 2);
zoomIm(1:10, 1:10, 3) = im(1, 1, 3);
But is there any efficient way??

답변 (1개)

Guillaume
Guillaume 2018년 8월 2일
im1(1:10, 1:10, :) = repmat(im2(1, 1, :), [10, 10, 1]);
  댓글 수: 3
Guillaume
Guillaume 2018년 8월 3일
Well, then use the conventional approach. There won't be anything simpler.
JAI PRAKASH
JAI PRAKASH 2018년 8월 3일
Ok
Thanx anyways :D

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by