Outline of shape in matrix using contour?
3 次查看(过去 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 个评论
更多回答(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!