Error using plot - Vectors must be the same lengths.
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi,
I got the error in the title of my question after running this part of code :
for i=1:size(X,3) % X is a MRI images sequence, it contains 30 images
ENDO = roipoly(size(X,1),size(X,2),XXendo(i,:),YYendo(i,:));
EPI = roipoly(size(X,1),size(X,2),XXepi(i,:),YYepi(i,:));
MYO = EPI-ENDO;
for j=1:6 % 6 is the number of myocardium sectors / segments
figure, plot((1:size(X,3)),(BW(:,:,j).*MYO))
end
end
The aim of this script is to plot the evolution of the 6 myocardium segments during the heart cycle (equivalent to 30 images).
ENDO is the endocardium, all the values inside it are equal to 1 and the values outside are equals to 0.
EPI is the endocardium, all the values inside it are equal to 1 and the values outside are equals to 0.
The size of BW is 162x174x6 and the size of MYO is 162x174. How can I fix this problem ?
Thank you for your help !
0 Kommentare
Akzeptierte Antwort
Andrei Bobrov
am 8 Jun. 2012
Please try EDIT2
n = size(X);
for i1=1:n(3) % X is a MRI images sequence, it contains 30 images
ENDO = roipoly(n(1),n(2),XXendo(i1,:),YYendo(i1,:));
EPI = roipoly(n(1),n(2),XXepi(i1,:),YYepi(i1,:));
MYO = EPI-ENDO;
for j1=1:6 % 6 is the number of myocardium sectors / segments
figure,imshow(BW(:,:,j1).*MYO);
end
end
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu MRI finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!