Subscripted assignment dimension mismatch.

1 vue (au cours des 30 derniers jours)
Stelios Fanourakis
Stelios Fanourakis le 3 Mai 2018
Modifié(e) : Ameer Hamza le 3 Mai 2018
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;

Réponse acceptée

KSSV
KSSV le 3 Mai 2018
newCanvass(row:end, column:end,:) = overlapImage(row:end, column:end,:);

Plus de réponses (1)

Ameer Hamza
Ameer Hamza le 3 Mai 2018
Modifié(e) : Ameer Hamza le 3 Mai 2018
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;

Catégories

En savoir plus sur DICOM Format dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by