Retime mean data not aligning
이전 댓글 표시
Hi there,
I'm using retime on a data set with a one second interval, to obtain averages for days and months (and many other intervals). One of the variables, Cool, in the table is a cooling % calculated from two other table variables, C1 and C2;
T1.Cool = 100*((T1.C1 - T1.C2) ./ T1.C1);
However when I use retime to change the interval of the data e.g.
TDay = retime(T1,"daily","mean");
The values of TDay.Cool is no longer the cooling difference between the new TDay.C1 and C2 variables. I.e. If Tday.C1 =100 and Tday.C2 = 90, Tday.Cooling shows as 9% rather than the actual cooling which is 10%.
What is happening in retime to get such behaviour and how can I correct it?
댓글 수: 5
Peter Perkins
2021년 8월 6일
Oliver, I think you are going to need to post a small example of your data. if Tday.C1=100, Tday.C2=90, and you set Tday.Cooling = 100*((Tday.C1 - Tday.C2) ./ Tday.C1), 9% seems impossible to end up with.
Oliver Higbee
2021년 8월 9일
Walter Roberson
2021년 8월 9일
I think we will need a data table to test with.
Oliver Higbee
2021년 8월 9일
Peter Perkins
2021년 9월 2일
Oliver, are you computing
mean(100*((T1.C1 - T1.C2) ./ T1.C1))
and expecting that to be the same as
100*((mean(TDay.C1) - mean(TDay.C2)) ./ mean(TDay.C1))
? Those are not the same thing.
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Call Python from MATLAB에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
