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

조회 수: 1 (최근 30일)
Viktor G.
Viktor G. 2020년 8월 4일
답변: Viktor G. 2020년 8월 4일
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
dpb 2020년 8월 4일
Read the doc more carefully...
TT2=retime(TT,'secondly',@std)

추가 답변 (1개)

Viktor G.
Viktor G. 2020년 8월 4일
Don't know how I've missed it. Thank you very much

카테고리

Help CenterFile Exchange에서 Tables에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by