I want put test 3 sigma on time series by 800*1 dimension. I have this code, it return nothing.

2 次查看(过去 30 天)
clc; clear all; close all;
fid=xlsread('rohi.csv');
x = fid(:,2); res = [];
upperbond = mean(x) + 3*std(x);
lowerbond = mean(x) - 3*std(x);
for n= 1:length(x)
if x(n) <= upperbond & x(n) >= lowerbond;
res=[x n];
emp_prob(x)=1
else
emp_prob(x)=0
end
end
what is problem?
Thanks in advance

回答(1 个)

Karim
Karim 2022-6-21
the error is because you intialize
lat = fid(:,2);
this means that 'lat' will be a vector with 1 column
next you ask for
lat(:,i)
or the i-th column, which will give an arror as soon as i becomes larger then 1

类别

Help CenterFile Exchange 中查找有关 Time Series 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by