필터 지우기
필터 지우기

Diagonal Line in fill plot?

조회 수: 3 (최근 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 CenterFile Exchange에서 Operating on Diagonal Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by