Smoothed daily count of each column by applying a moving average filter of length 7
1 次查看(过去 30 天)
显示 更早的评论
I have used readtable command to get data from an excel file. and smoothing data of one column. i.e 6th column. But it's giving an error. How can we apply Smoothed daily count of each column by applying a moving average filter of length 7?
clc
clear all
T = readtable('C:\Users\SAS\Downloads\ABC.xlsx', 'Range' , 'A1:AH154')
% Calculate daily counts
c=T(:,6)
yy=smooth(c)
0 个评论
回答(1 个)
Thiago Henrique Gomes Lobato
2020-6-7
If your table has numeric values, then:
c=T{:,6};
yy=smooth(c,7)
If your table has string values that should represent numeric ones:
yy=smooth( cell2mat( arrayfun(@(x)str2double(x),c,'uniformoutput',0) ),7)
3 个评论
Thiago Henrique Gomes Lobato
2020-6-7
Have you noticed the following notation
c=T{:,6};
instead of
c=T(:,6)
?
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!