Error using plot - Vectors must be the same lengths.

1 回表示 (過去 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
  1 件のコメント
K BV
K BV 2012 年 6 月 11 日
Thank you ! It is working now :-)

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMRI についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by