Variable time series data

조회 수: 1 (최근 30일)
Remember Samu
Remember Samu 2021년 6월 19일
댓글: Remember Samu 2021년 6월 20일
Hi All,
Please can anyone please help me with a code that can identify if a day had varrying/fluctuating irradiance from the attached txt file. The code should be able differentiate a clear day which follows a normal distribution from a day with intermittent/varrying irradiance (partly cloudy day). Please see attached sample txt file.

채택된 답변

Sulaymon Eshkabilov
Sulaymon Eshkabilov 2021년 6월 19일
(1) Import the data into matlab using textscan() or fscanf() or best readtable()
%% Set up the Import Options and import the data
opts = delimitedTextImportOptions("NumVariables", 7);
% Specify range and delimiter
opts.DataLines = [16, Inf];
opts.Delimiter = "\t";
% Specify column names and types
opts.VariableNames = ["locationlatitudedegN32066132", "VarName2", "VarName3", "VarName4", "VarName5", "VarName6", "VarName7"];
opts.VariableTypes = ["datetime", "datetime", "double", "double", "double", "double", "double"];
% Specify file level properties
opts.ExtraColumnsRule = "ignore";
opts.EmptyLineRule = "read";
% Specify variable properties
opts = setvaropts(opts, "locationlatitudedegN32066132", "InputFormat", "dd/MM/yyyy");
opts = setvaropts(opts, "VarName2", "InputFormat", "HH:mm:ss");
% Import the data
DATA = readtable("20210107T000414.txt", opts);
(2) Select the data for processing
D1 = DATA.VarName6;
D2 = DATA.VarName6;
(3) Histogram analysis
DL=8640;
Day1 = D1(1:DL);
Day2 = D2(DL+1:2*DL);
Day3 = D2(2*DL+1:3*DL);
...
figure()
histfit(Day1)
...
  댓글 수: 1
Remember Samu
Remember Samu 2021년 6월 20일
Hi Sulaymon,
Thank you so much. However, I am facing the following error. Could you please help,
variable_days
Error using matlab.io.ImportOptions/setvaropts (line 485)
Expected a name or numeric index of a variable name.
Error in variable_days (line 17)
opts = setvaropts(opts, "locationlatitudedegN32066132", "InputFormat",
"dd/MM/yyyy");
****Line 17: opts = setvaropts(opts, "locationlatitudedegN32066132", "InputFormat", "dd/MM/yyyy");

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Digital Filter Analysis에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by