Using Diff() with NaN values
古いコメントを表示
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 件のコメント
david crowley
2021 年 4 月 3 日
編集済み: david crowley
2021 年 4 月 3 日
回答 (1 件)
Sulaymon Eshkabilov
2021 年 4 月 2 日
0 投票
You can substitute all 'nan' values with 0's by locating them via isnan() and then substituting.
カテゴリ
ヘルプ センター および File Exchange で Time Series についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!