Diagonal Line in fill plot?

5 ビュー (過去 30 日間)
Jake Simmonds
Jake Simmonds 2018 年 11 月 20 日
コメント済み: Jake Simmonds 2018 年 11 月 20 日
Got i hope a simple question for you all , in my foillowing code i have a random diagonal line and i have no idea where it is coming from?
any help would be great thank you in advance :)
RoadVerts =[-1, 9, 9, 11, 11, 21, 21, 11, 11, 9, 9, -1, -1
11, 11, 21, 21, 11, 11, 9, 9, -1, -1, 9, 9, 11
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1];
fill(RoadVerts(1:1,:),RoadVerts(1:2,:),'w');
xlim([0 20])
ylim([0 20])
zlim([0 5])
  2 件のコメント
Jan
Jan 2018 年 11 月 20 日
A screenshot would be useful.
Jake Simmonds
Jake Simmonds 2018 年 11 月 20 日
Capture.PNG

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

採用された回答

Jan
Jan 2018 年 11 月 20 日
編集済み: Jan 2018 年 11 月 20 日
I guess you mean the diagonal from (0,0) to (21,21). Change the fill command to:
% Was: fill(RoadVerts(1:1,:),RoadVerts(1:2,:),'w');
fill(RoadVerts(1,:), RoadVerts(2,:), 'w');
1:1 can be simplified to 1, and 1:2 as second coordinate is most likely a typo.
  3 件のコメント
Jake Simmonds
Jake Simmonds 2018 年 11 月 20 日
Capture.PNG
Jake Simmonds
Jake Simmonds 2018 年 11 月 20 日
Much nicer now :)

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeOperating on Diagonal Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by