Averaging array, checking conditional, and increment average points.
1 回表示 (過去 30 日間)
古いコメントを表示
I am attempting to solve the following issue that I wrote in a step sequence:
1 - I have an array of 250 points and I want to take the average of the 1st 10 points.
2 - If the 11th point in the 250 point array is 1.25x bigger than the average -----> I want to look at the 12th point in the array to see if this value is larger than the 11th point (and so on).
2b - If the next point is no longer larger, I want to save the maximum point.
3 - If the next point outside of the 10 point average is not 1.25x bigger, I want to remove the first point of the average, and add the next point in the array:
Ex. 1st average (1 through 10) ----> check 11th point to see if 1.25x bigger ----> no: average (2 through 11) ----> check 12th point to see if 1.25x larger ----> yes: check 13th point to see if greater than or equal to 12th point ------> yes: check 14th point to see if greater than or equal to 13th point ----> no: store 13th point.
Once the maximum point is found, restart the array averaging at the maximum point.
I am new to Matlab and struggling with this issue.
Thank you!
1 件のコメント
KALYAN ACHARJYA
2019 年 9 月 25 日
Check here, suggested you to try yourself,it's easy, I am sure, you can. Any issue we are here to help you.
Good Luck!
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Logical についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!