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

1 次查看(过去 30 天)
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 中查找有关 Data Type Conversion 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by