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

2 views (last 30 days)
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

Answers (1)

Karim
Karim on 21 Jun 2022
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

Categories

Find more on Time Series in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!