hello everyone please can someone help me with stock price prediction. That is I wrote this code and from the I vector , I want a code that will remove indexes from the I vector more than 60 seconds. Thanks

1 ビュー (過去 30 日間)
Afua Amoako Dadey
Afua Amoako Dadey 2020 年 7 月 6 日
コメント済み: Afua Amoako Dadey 2020 年 7 月 9 日
LSE_matrix =log(nstock_val); %log of the data
I=1:(size(LSE_matrix,1)-1); % selecting the indices of all prices but the last time when stock was opened
dLSE_col1 = LSE_matrix(I+1,1) - LSE_matrix(I,1);% log difference
  5 件のコメント
jonas
jonas 2020 年 7 月 6 日
Dont you think it would be easier if you upload a sample of the data?

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

採用された回答

jonas
jonas 2020 年 7 月 6 日
編集済み: jonas 2020 年 7 月 6 日
You can adapt this to your needs
A = readtable('LSE1.csv')
t = datetime(A{:,1},'inputformat','dd.MM.yyyy HH:mm:ss.SSS')
data = A{:,2:end};
id = [false;diff(t)>seconds(60)];
data(id,:) = [];
t(id) = [];
If the period between t(n) and t(n+1) is longer than 60s, then the data recorded at t(n+1) is deleted.
  6 件のコメント
Afua Amoako Dadey
Afua Amoako Dadey 2020 年 7 月 9 日
Okay, Mr Jonas. I really appreciate the help

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

その他の回答 (1 件)

Afua Amoako Dadey
Afua Amoako Dadey 2020 年 7 月 6 日
Please find attached

Community Treasure Hunt

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

Start Hunting!

Translated by