File Exchange

image thumbnail

gap size

version 1.1 (1.22 KB) by

Calculates number of consequtive NaNs in a vector.

0 Downloads

Updated

View License

USAGE: sz=gapsize(x)

EXAMPLE:
  x=rand(20,1);
  x(x>.5)=nan;
  [x gapsize(x)]

--------------
ans =
          NaN 2
          NaN 2
      0.33311 0
      0.28511 0
      0.38263 0
      0.20227 0
      0.37058 0
      0.43658 0
          NaN 1
    0.0049841 0
          NaN 1
     0.015303 0
          NaN 1
      0.26592 0
          NaN 4
          NaN 4
          NaN 4
          NaN 4
      0.20113 0
          NaN 1

Comments and Ratings (2)

Aslak Grinsted

Aslak Grinsted (view profile)

Thanks for the suggestion, -it has been added.

C.J. Harris

I'd recommended you adding support for row vectors - currently only column vectors are supported.

Updates

1.1

FIX: Allow row-vectors.

MATLAB Release
MATLAB 7 (R14)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video