using varfun on a timetable with subscripts?
Show older comments
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?
Accepted Answer
More Answers (0)
Categories
Find more on Workspace Variables and MAT Files in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!