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

1 ビュー (過去 30 日間)
SAS 2020 年 6 月 7 日
コメント済み: Image Analyst 2020 年 6 月 7 日
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
% Calculate daily counts
c=T(:,6)
yy=smooth(c)

サインインしてコメントする。

### 回答 (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 件のコメント

SAS 2020 年 6 月 7 日
It's giving an error...
Subscripting into a table using one subscript (as in t(i)) or three or more subscripts (as in t(i,j,k)) is not supported. Always specify a row subscript and a variable subscript, as in t(rows,vars).
Thiago Henrique Gomes Lobato 2020 年 6 月 7 日
Have you noticed the following notation
c=T{:,6};
c=T(:,6)
?
Image Analyst 2020 年 6 月 7 日

サインインしてコメントする。

### Community Treasure Hunt

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

Start Hunting!

Translated by