Is it possible to add a string to an array of NaN The next example does not work N = NaN(10,1); N(5,1)='Stop'; the result should be a column of NaN but the fifth element is Stop.
Thanks Aziz
Best Answer
No. NaN is numeric, but 'Stop' is a character string. It is not possible to have numbers and characters in the same array.
You may use the attached M-function for this purpose.
NAN2STRCELL accepts a cell array as input. It searches for NaN elements and replaces them with the string 'NaNstring'. The output is the modified cell array.
Like that, each value of "a" is correlated to each value of "b", but applying the formula of the correlation, the correlation of two single numbers is NaN. To compute the correlation correctly, traspose the input vectors
Best Answer