please i need all iteration in one vector

1 view (last 30 days)
clear,clc
data=xlsread('standing.xlsx');
accy=data(:,2);
inc=120;
for i=1:inc:length(accy)-rem(length(accy),inc);
j=i+inc-1;
dev =std(accy(i:j,:))
end

Accepted Answer

Kuifeng
Kuifeng on 13 Apr 2016
inc = 120;
accy(length(accy)-rem(length(accy),inc)+1:end) = [];
accy_2D = reshape(accy, inc, (length(accy)-rem(length(accy),inc))/inc);
dev = std(accy_2D);
  2 Comments
amr atyia
amr atyia on 13 Apr 2016
thank you very much you are a professional it's okay but i don't understand the code
Kuifeng
Kuifeng on 14 Apr 2016
the second line removes the numbers after the row 1201.
The third line reshape this one vector to a 2D-Array with 120 rows, and 10 columns.
The last calculate std in each column

Sign in to comment.

More Answers (0)

Categories

Find more on Loops and Conditional Statements in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!