|
"Vihang Patil" <vihang_patil@yahoo.com> wrote in message <jemhqj$hs3$1@newscl01ah.mathworks.com>...
> Hello
> I have this particular type or array,example
>
> a = [0 0.0360 NaN NaN NaN 0.0040 0.0530 NaN NaN NaN NaN 0.0080 NaN NaN ]
> Now I want the array b such that
> b = [0 0.0040 0.0080] and its indices as well such that
> index = [1 6 12]
> so on and so forth
> My main aim is to get only the first numeric value in between the 2 NaN's, if there are 2 or more numeric values in between the NaN's I want to ignore them
> How do I achieve this?
>
> Thanks
>
> Vihang
something like this?
b = a(diff(isnan([NaN,a,NaN]))==-1)
|