Error using plot - Vectors must be the same lengths.

조회 수: 5 (최근 30일)
K BV
K BV 2012년 6월 8일
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 !

채택된 답변

Andrei Bobrov
Andrei Bobrov 2012년 6월 8일
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

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by