logo资料库

matlab smooth函数c代码.docx

第1页 / 共1页
资料共1页,全文预览结束
bool Smooth(int s, float Z[], int start, int end, float D[], int k){ int b = (k - 1) / 2; if ((end - start + 1)>k) { for (int i = start; i <= end; i++) { if ((i - start) <= b)//第一段 { } Z[i - start + s] = 0; int j = start; for (; j <= 2 * i - start; j++) { } Z[i - start + s] += D[j]; Z[i - start + s] = Z[i - start + s] / ((i - start) * 2 + 1); else if (((i - start)>b) && ((end - i)>b))//第二段 { } Z[i - start + s] = 0; for (int j = i - b; j <= i + b; j++) { } Z[i - start + s] += D[j]; Z[i - start + s] = Z[i - start + s] / k; else//第三段 Z[i - start + s] = 0; for (int j = 2 * i - end; j <= end; j++) { } Z[i - start + s] += D[j]; Z[i - start + s] = Z[i - start + s] / (2 * (end - i) + 1); { } } } return true; }
分享到:
收藏