I'm having trouble removing NaN from this matrix
cabos= [1x26 char] 'InĂcio' 'Fim' [1x20 char] 'N. volt. level [KV]' [2.0088e+03] 'SE S M Portuzelo' 'PTD 0526' [ 18.6057] [ 15] [ 169.0442] 'PTC 5452' 'PTD 0450' [ 18.6057] [ 15] [ 446.3509] 'PTD 0039' 'PTC 2850' [ 18.6057] [ 15] [ 635.2552] 'PTD 0450' 'PTD 0039' [ 18.6057] [ 15] [ 255.5464] 'PTD 0450' 'PTD 0090' [ 18.6057] [ 15] [4.2281e+03] 'PTD 0526' 'PTC 5452' [ 18.6057] [ 15] [ NaN] [ NaN] [ NaN] [ NaN] [ NaN] [ NaN] [ NaN] [ NaN] [ NaN] [ NaN] [ NaN] [ NaN] [ NaN] [ NaN] [ NaN]
I tried this code and it removes de NaN values, but it completely rearanges the matrix and i can't solve this
cabos(cellfun(@(cabos) any(isnan(cabos)),cabos)) = []
Best Answer