I want to extract data from one table and move into another from specific location in the first table.
2 次查看(过去 30 天)
显示 更早的评论
I have created a code to compute the centered moving standard deviation of a data in a table, now I want to get the data starting from the 4th position to the last position with an increment of 5 between the positions.
I wrote a code which is extracting the st dev from the table and then I created a table of the length of the number of data points I want to extract from the second table, but when I tried to put it into the second table the out was just zeros.
Please help!
clear;
clc
close all;
T = readtable('NSEI1.csv');
T.Date = datetime(T.Date,'Format','dd-MM-uuuu');
M = movstd(T.Open,[3 1]);
g=length(M)
f=round((g/5))+1;
h = zeros(f,1);
for i=4:5:length(g)
h=[h;M(i)];
end
disp(h);
The output of this is just a table of zeros please help!
1 个评论
Hayden Raabe-Garmon
2023-3-16
% M = movstd(T.Open,[3 1]);
M=[1:100] % just so I can test it without your CSV
g=length(M)
f=round((g/5))+1;
h=M(4:5:length(M))
回答(1 个)
Hayden Raabe-Garmon
2023-3-16
% M = movstd(T.Open,[3 1]);
M=[1:100] % just so I can test it without your CSV
g=length(M)
f=round((g/5))+1;
h=M(4:5:length(M))
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!