I have a double column vector as follows:
[1;NaN;NaN;2;NaN;NaN;3;NaN;NaN;] What I'd like to do is create a string variable name on the NaN elements that follow the numbers. For example, I'd like my final vector to look like this:
[1;wd1;wd1;2;wd2;wd2;3;wd3;wd3] Can anyone help out? Thanks!
NaNis compatible with that. A random string is not. So there are follow up questions on what you ask: Is it ok to change that type? For example to use cells instead? Is there any significance on the "string variable name" or all you want to do is replaceNaNs with specific strings? Finally, is this a pattern that between the number 1 and the next number 2 allNaNs should be converted towd1?