finding longest length

1 次查看(过去 30 天)
Mohammad Golam Kibria
Hi ,I have a matrix as follows I =
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 1 0 0 0 0 0
0 0 1 0 1 0 0 0 1 0
0 1 0 1 1 0 1 0 0 1
1 0 0 0 1 0 1 1 0 0
0 0 0 0 1 0 1 0 0 0
0 1 1 1 0 1 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
I need the output as follows:
I =
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 1 0 0 0 0 0 1 0
0 1 0 1 0 0 0 0 0 1
1 0 0 0 0 0 0 1 0 0
0 0 0 0 1 0 1 0 0 0
0 0 0 0 0 1 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
i.e only the longest length of pixel that touches two opposite boundary.can any body help please?Thanks

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 NaNs 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by