Outline of shape in matrix using contour?
조회 수: 2 (최근 30일)
이전 댓글 표시
Hi all!
I have a matrix with various shapes. The matrix looks something like this (picture included below) when I use the imshow command. I was wondering if anyone knew how to outline the shapes so that only the outline of the shape (i.e. the boundaries) appears. I tried using contourf, and it works, but this flips the image upside down. Any other options?
I have included some code for reference:
shape = ncread(file, 'shape', [1,1,1,612,1], [inf, inf, inf, 1, inf])
imshow(shape)
contourf(shape)
Thanks in advance!
댓글 수: 0
채택된 답변
Star Strider
2020년 11월 13일
Try this:
figure
contourf(shape)
set(gca, 'YDir','reverse')
axis('equal')
That should fiip it right-side-up.
댓글 수: 2
Star Strider
2020년 11월 16일
As always, my pleasure!
I very much appreciate your compliment! You, too!
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Contour Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!