Interpolate include NaN data.
Mostrar comentarios más antiguos
Data likes this
-----
3
NaN
NaN
7
NaN
NaN
2
NaN
NaN
19
NaN
NaN
12
-----
How interpolate NaN data?
I try interp1 fuction. But I failed.
Please help me.
1 comentario
Jan
el 14 de Nov. de 2016
Whenever you post "failed" in the forum, add your code and explain the error.
Respuesta aceptada
Más respuestas (1)
Jan
el 14 de Nov. de 2016
data = [3, NaN, NaN, 7, NaN, NaN, 2, NaN, NaN, 19, NaN, NaN, 12];
miss = isnan(data);
data(miss) = interp1(data(~miss), find(~miss), find(miss))
4 comentarios
Jeong_evolution
el 14 de Nov. de 2016
Jan
el 14 de Nov. de 2016
"~" is the NOT operator. Try this:
data = [3, NaN, NaN, 7, NaN, NaN, 2, NaN, NaN, 19, NaN, NaN, 12];
miss = isnan(data);
disp(miss)
disp(~miss)
Jeong_evolution
el 18 de Nov. de 2016
Jeong_evolution
el 18 de Nov. de 2016
Categorías
Más información sobre Logical en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!