Smoothed daily count of each column by applying a moving average filter of length 7

2 visualizaciones (últimos 30 días)
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)

Respuestas (1)

Thiago Henrique Gomes Lobato
Thiago Henrique Gomes Lobato el 7 de Jun. de 2020
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 comentarios
Image Analyst
Image Analyst el 7 de Jun. de 2020
Please attach 'C:\Users\SAS\Downloads\ABC.xlsx', if you need more help.

Iniciar sesión para comentar.

Categorías

Más información sobre Tables en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by