CAT arguments dimensions are not consistent.

for i = 1:size(LinkMat,1)
d = LinkMat(:,6)/(c*10);
plot([LinkMat(i,2),LinkMat(i,4)],[LinkMat(i,3),LinkMat(i,5)], 'Color', [0 d 0] );
end
I am getting error at the Plot function probably due to Color. Can't we specify a variable in the matrix ???

 採用された回答

Youssef  Khmou
Youssef Khmou 2013 年 3 月 7 日
編集済み: Youssef Khmou 2013 年 3 月 7 日

0 投票

as you get CAT dimensions consistency then your equation " d = LinkMat(:,6)/(c*10);" does not return a scalar but a matrix , try to correct so as the color vector to be comprised of three scalars

2 件のコメント

Jujhar Khurana
Jujhar Khurana 2013 年 3 月 7 日
Thanks Youssef. One other question. LinkMat in above case is a column in a .csv file and I want to iterate over it. How can I get the value in current row in LinkMat as the loop is iterating over it.
Walter Roberson
Walter Roberson 2013 年 3 月 7 日
d = LinkMat(i,6) / (c*10);

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

その他の回答 (1 件)

Jan
Jan 2013 年 3 月 7 日

0 投票

d = LinkMat(:,6)/(c*10);
for i = 1:size(LinkMat,1)
plot(LinkMat(i, [2,4]), LinkMat(i,[3,5]), 'Color', [0, d(i), 0] );
end

1 件のコメント

Jujhar Khurana
Jujhar Khurana 2013 年 3 月 14 日
Thank you so much Jan Simon

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

カテゴリ

ヘルプ センター および File ExchangeSurfaces, Volumes, and Polygons についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by