Error using plot - Vectors must be the same lengths.

1 vue (au cours des 30 derniers jours)
K BV
K BV le 8 Juin 2012
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 !

Réponse acceptée

Andrei Bobrov
Andrei Bobrov le 8 Juin 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
  1 commentaire
K BV
K BV le 11 Juin 2012
Thank you ! It is working now :-)

Connectez-vous pour commenter.

Plus de réponses (0)

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by