# how to replace multiple values per second with their standard deviaton?

조회 수: 7(최근 30일)
Viktor G. 4 Aug 2020
답변: Viktor G. 4 Aug 2020
I know about the function that gives you the mean value of the multiple data points however in this case I need their standard deviaton, so this function wont do it.
TT2 = retime(TT,'hourly','mean')
I am guessing i have to use a for loop, but i am just wondering if there is a more efficent way to do it other than comparing all of the values. I have a table that has 200 values per second and in the end i just need to have 1 value per second that is equal to the standard deviation of those 200. I am using this for loop
for i=i:200:L-r
Y1(k,:)=std(Z(i:(i+200-1),:));
k=k+1;
end
However I am not always sure that there are exactly 200 values per second (for example there might be 199 or 201 sometimes), and that is where the function mentioned first would've been helpfull. I would appreciate any help.
Var1 Var2 Var3
___________________ _______ _______
01/02/2014 00:07:24 -3.5469 -102.63
01/02/2014 00:07:24 -5.0115 -102.78
01/02/2014 00:07:24 -6.7526 -103.03

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

### 채택된 답변

dpb 4 Aug 2020
TT2=retime(TT,'secondly',@std)

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

### 추가 답변(1개)

Viktor G. 4 Aug 2020
Don't know how I've missed it. Thank you very much

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

### Community Treasure Hunt

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

Start Hunting!

Translated by