How can i fill intermediate dates?
2 ビュー (過去 30 日間)
古いコメントを表示
Fernando Galdames Paredes
2014 年 6 月 5 日
コメント済み: Star Strider
2014 年 6 月 5 日
Hi
I have a matrix with dates and prices.(Nx2) I know there is a function that can create a new matrix that fills all the dates missing in the matrix using the last price available.
For example:
('05-20-2014' 800 ;'05-24-2014' 850) => ('05-20-2014' 800;'05-21-2014' 800 ;'05-22-2014' 800;'05-23-2014' 800;'05-24-2014' 850)
Best Regards
0 件のコメント
採用された回答
Star Strider
2014 年 6 月 5 日
First, convert your date to date numbers with the datenum function. It gives days and decimal fractions-of-days, so you only need to specify integer date ranges for interpolation.
The interp1 function will interpolate all the columns in every row of your matrix you want to interpolate.
2 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Time Series Objects についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!