Delete "dead zone" from array
1 次查看(过去 30 天)
显示 更早的评论
Hi everyone,
I was wondering if there was a way to quickly remove a region of "dead" signal from an array that contains only zeros.
Example: say i have the following array
[1 6 6 4 3 4 6 0 2 0 2 5 6 4 3 8 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6 4 3 6 2]
Is there a way to find and delete the dead section?
[1 6 6 4 3 4 6 0 2 0 2 5 6 4 3 8 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6 4 3 6 2]
[1 6 6 4 3 4 6 0 2 0 2 5 6 4 3 8 0 0 0 1 6 4 3 6 2]
Thanks!
JF
2 个评论
Jan
2012-7-19
编辑:Jan
2012-7-19
Of course a useful answer can only be given, when you define "dead zone" exactly. E.g. why is the highlighted zone in your example dead, but the former [0,0,0] is alive?
It is not likely that a solution is successful, if it is based on guessing what the actual problem is.
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Loops and Conditional Statements 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!