一段小程序,最后结果是计算实部和虚部数值,同时需要画出数据的图形并做出拟合。出现的问题在下面代码的警告部分,请高手帮忙看看如何做修改,最好能给出些提示。非常感谢,如有问题可发邮件:fangdy@outlook.com。另附程序内容也可详见附件。
>> x=[1.84E-04 3.45E-04 4.81E-04 7.17E-04 9.17E-04 1.17E-03 1.51E-03 1.76E-03 2.13E-03 2.38E-03 2.70E-03 2.91E-03 3.05E-03];
>> jiaodu=[7.73E+01 7.28E+01 6.93E+01 6.42E+01 6.01E+01 5.53E+01 4.91E+01 4.45E+01 3.77E+01 3.30E+01 2.66E+01 2.23E+01 1.92E+01];
>> hudu=deg2rad(180.-jiaodu);
>> z=x./0.6;
>> G=1./z;
>> xx=G.*cos(hudu);
>> yy=G.*sin(hudu);
>> plot(xx,yy,'^')
>> zz=sqrt(xx.^2+yy.^2);
>> [xInput, yInput, zOutput] = prepareSurfaceData( xx, yy, zz );
>> ft = fittype( 'a + b*x + c*y', 'indep', {'x', 'y'}, 'depend', 'z' );
>> h= fit( [xInput, yInput], zOutput, ft);
警告: Start point not provided, choosing random start point.
> In Warning>Warning.throw at 30
In fit>iFit at 312
In fit at 108
>> coe=coeffvalues(h);
>> aa=coe(2)/2;
>> bb=coe(3)/2;
>> r=sqrt(coe(1)+aa^2+bb^2);
>> sita=0:pi/20:2*pi;
>> hold on
>> plot(aa+r*cos(sita),bb+r*sin(sita));
>> hold on
>> plot(aa,bb,'.');
>> x1=aa-sqrt(r^2-bb^2);
>> x2=aa+sqrt(r^2-bb^2);
>> RE=1/x1;
>> RI=1/(x2-x1)