How do I use the timeseries values as a normal vector
4 views (last 30 days)
Show older comments
I have a long timeseries like this:
timeseries
Common Properties:
Name: 'unnamed'
Time: [186721x1 double]
TimeInfo: tsdata.timemetadata
Data: [1x1x186721 double]
DataInfo: tsdata.datametadat
lets call the timeseries object vehicleSpeed.
When I want to filter the data using conv like this
mask = ones(1,3);
filteredSpeed = conv(vehicleSpeed.data,mask,'same')
I get the following error
Error using conv (line 27)
A and B must be vectors
I have tried different metohods of using this timeseries as a vector without success. Please help.
1 Comment
dpb
on 8 Nov 2013
Looks like you somehow (inadvertently?) created the time series containing a cell array instead of a vector. Not sure how managed it; a simple experiment here to try to duplicate the above was unsuccessful.
I'd suggest recreating the timeseries object avoiding that if at all possible; if for some reason that's mandatory you can wrap the arguments to conv in a cell2mat call and that should, I believe, work--albeit klunky.
Perhaps show how you created the timeseries object would lead to better idea of how to avoid the problem to begin with.
Answers (0)
See Also
Categories
Find more on Time Series 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!