필터 지우기
필터 지우기

sum of time series performace

조회 수: 5 (최근 30일)
Khan Muhammad Adeel Khan
Khan Muhammad Adeel Khan 2022년 10월 19일
편집: Les Beckham 2022년 10월 19일
I want to check the time series performance and have 150 trials in total and each trial is associated with either +1 or -1. I want o calculate it in such a way:
x=[mean(a(1:10)),mean(a(2:11)),mean(a(3:13)),mean(a(4:14)),........,mean(a(141:150))];

답변 (1개)

Les Beckham
Les Beckham 2022년 10월 19일
편집: Les Beckham 2022년 10월 19일
Your question isn't very clear but it appears that perhaps you want to do a moving average. Take a look at the documentation for the movmean function here: movmean
Possibly this would do what you want:
x = movmean(a, 10);
  댓글 수: 7
Khan Muhammad Adeel Khan
Khan Muhammad Adeel Khan 2022년 10월 19일
Thank you for the prompt response once again. But in this case, how I can get up to 2 decimal points? If there is any solution, please guide me
Les Beckham
Les Beckham 2022년 10월 19일
편집: Les Beckham 2022년 10월 19일
There is no way you can sum up ten ones and negative ones and divide by ten and get anything that requires more than one decimal place to express. The answer is correct to two decimal places but the second decimal place is always going to be zero in this case.

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

카테고리

Help CenterFile Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by