using varfun on a timetable with subscripts?
显示 更早的评论
Is it possible to use varfun on a timtable and include subscripts?
Say I have a large timetable of stock prices and wanted to do a simple caluclation on each price element, but the caluclation requires previous elements, is this possible using varfun?
Ideally I want a timetable returned which is why I do not want to use subscripting as it will only return a matrix.
As a simple example, say I wanted the difference between each element and its previous element, using subscript: stocks{2:end, :} - stocks{1: end -1, : }, but I lose the date index as a result. Is there a way to do this in varfun using an anonymous function?
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Workspace Variables and MAT Files 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!