主页 > 数据处理 > 智能仪器中的数据处理及算法综述

智能仪器中的数据处理及算法综述

2022-02-10 07:56来源:m.sf1369.com作者:宇宇

1、论文符合格式要求;2、必须有论文摘要(中英文);3、论述各种数据处理算法(数制转换、误差处理等等);4、必须有软件流程图或代码

数据挖掘 算法

第一题结果:

#include <stdio.h>

#define DATALEN 27

int data[DATALEN]=

{13, 15, 16,

16, 19, 20,

20, 21, 22,

22, 25, 25,

25, 25, 30,

33, 33, 35,

35, 35, 35,

36, 40, 45,

46, 52, 70};

int nSmoothByMeans[DATALEN]={0};

int nSmoothByMedians[DATALEN]={0};

int nSmoothByBoundaries[DATALEN]={0};

void SmoothByMeans(int depth)

{

int i=0,j=0;

int sum=0 , mean=0;

for(i=0;i<27;i=i+3)

{

for (j=i;j<i+depth;j++)

{

sum+=data[j];

}

mean = sum/depth;

for (j=i;j<i+depth;j++)

{

nSmoothByMeans[j]=mean;

}

sum = 0;

}

}

void SmoothByMedians(int depth)

{

int i=0,j=0;

for(i=1;i<27;i=i+3)

{

for (j=i-1;j<i+depth;j++)

{

nSmoothByMedians[j]=data[i];

}

}

}

void SmoothByBoundaries(int depth)

{

int i=0,j=0;

for(i=0;i<27;i++)

{

nSmoothByBoundaries[i]=data[i];

}

for (i=1;i<27;i=i+3)

{

if (data[i]-data[i-1]>data[i+1]-data[i])

{

nSmoothByBoundaries[i]=data[i+1];

}

else

{

nSmoothByBoundaries[i]=data[i-1];

}

}

}

void main()

{

int depth = 3;

int i=0;

int j=0;

SmoothByMeans(3);

SmoothByMedians(3);

SmoothByBoundaries(3);

printf(原始数据:\n);

for(i=0,j=1;i<27;i=i+3,++j)

{

printf(Bin %d : %d,%d,%d\n,

j,data[i],data[i+1],data[i+2]);

}

printf(使用平均值:\n);

for(i=0,j=1;i<27;i=i+3,++j)

{

printf(Bin %d : %d,%d,%d\n,

j,nSmoothByMeans[i],nSmoothByMeans[i+1],nSmoothByMeans[i+2]);

}

printf(使用中值:\n);

for(i=0,j=1;i<27;i=i+3,++j)

{

printf(Bin %d : %d,%d,%d\n,

j,nSmoothByMedians[i],nSmoothByMedians[i+1],nSmoothByMedians[i+2]);

}

printf(使用边界值:\n);

for(i=0,j=1;i<27;i=i+3,++j)

{

printf(Bin %d : %d,%d,%d\n,

j,nSmoothByBoundaries[i],nSmoothByBoundaries[i+1],nSmoothByBoundaries[i+2]);

}

}

相关推荐

车联网企业国内有哪些?

数据处理 2023-12-23

注册计量师-请教贴

数据处理 2023-12-19

逆光照片怎么处理

数据处理 2023-12-08