How do I use the timeseries values as a normal vector
4 次查看(过去 30 天)
显示 更早的评论
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 个评论
dpb
2013-11-8
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.
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Time Series 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!