Using Diff() with NaN values
Mostrar comentarios más antiguos
I am trying to find the difference between rows using the diff() function. However, because the rows contain NaN values I am getting the following error.
'Check for missing argument or incorrect arugument data type in call to function diff'
The data is a timetable with weekly closing stock prices and I just need to calculate the difference in price between weeks.
1 comentario
david crowley
el 3 de Abr. de 2021
Editada: david crowley
el 3 de Abr. de 2021
Respuestas (1)
Sulaymon Eshkabilov
el 2 de Abr. de 2021
0 votos
You can substitute all 'nan' values with 0's by locating them via isnan() and then substituting.
1 comentario
david crowley
el 3 de Abr. de 2021
Categorías
Más información sobre Time Series 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!