MATLAB Answers

John F

Delete "dead zone" from array

Asked by John F
on 19 Jul 2012

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 Comments

Jan Simon
on 19 Jul 2012

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.

John F
on 19 Jul 2012

I couldn't agree more. I collected data in spurts of 1.25 million points at a high rate. If an error occurred in writing the file, an array of zeros resulted. I might have to look at the guts of the file to find out what triggered the "all zero" report and factor that into my analysis.

Thanks for clarifying!

Products

No products are associated with this question.

0 Answers

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply today