(C语言)最小二乘法的曲线拟合.docVIP

  • 60
  • 0
  • 约1.87千字
  • 约 3页
  • 2020-08-06 发布于浙江
  • 举报
/*最小二乘法的曲线拟合*/ #includestdio.h #includemath.h #includestdlib.h #define max 100 void main() { int i,j,k,m,N,mi; float mx,temp; float X[max][max],Y[max],x[max],y[max],a[max]; FILE *fp1; if((fp1=fopen(in1.txt,r))==NULL) /*输入拟合曲线的次数m以及已知的数据组数N*/ { printf(Cant open this file!\n); exit(0); } for(i=0;i2;i++) fscanf(fp1,%d%d,m,N); fclose(fp1); FILE *fp2; if((fp2=fopen(in2.txt,r))==NULL) /*输入已知的N组数据坐标*/ { printf(Cant open this file!\n); exit(0); }

文档评论(0)

1亿VIP精品文档

相关文档