Subscripted assignment dimension mismatch.

조회 수: 16 (최근 30일)
Stelios Fanourakis
Stelios Fanourakis 2018년 5월 3일
편집: Ameer Hamza 2018년 5월 3일
I use this code
referenceImage = 'test1.dcm';
overlapImage = 'test3.dcm';
% Create blank new canvass the same size as the reference image.
newCanvass = zeros(size(referenceImage), 'uint8');
% Place overlap image down at row, column
data = dlmread('imgpositions.txt');
[row, column] = size(data);
newCanvass(row:end, column:end) = overlapImage;
And I get the error (see subject line) at newCanvass(row:end, column:end) = overlapImage;

채택된 답변

KSSV
KSSV 2018년 5월 3일
newCanvass(row:end, column:end,:) = overlapImage(row:end, column:end,:);

추가 답변 (1개)

Ameer Hamza
Ameer Hamza 2018년 5월 3일
편집: Ameer Hamza 2018년 5월 3일
Something like this will work. Although I wonder are you correctly initializing values of row and column
[height, width] = size(overlapImage);
newCanvass(row:row+height-1, column:column+width-1, :) = overlapImage;

카테고리

Help CenterFile Exchange에서 DICOM Format에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by