概述
#define N 10
float get_avag(float *a,float angle) {
float sum = 0;
for (int i = 0; i < N-1; i++) {
a[i] = a[i + 1];
}
a[N - 1] = angle;
for (int i = 0; i < N; i++) {
sum += a[i];
}
return sum / N;
}
int main()
{
float angle;
float a[] = { 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0};
while (true) {
cin >> angle;
cout << endl;
cout << get_avag(a,angle) << endl;
}
return 0;
}
最后
以上就是会撒娇哈密瓜为你收集整理的滑动均值滤波C++实现的全部内容,希望文章能够帮你解决滑动均值滤波C++实现所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复