近似でエラーが発生し​ました。どなたか解消​方法を教えていただき​たいです。

4 次查看(过去 30 天)
shunya hara
shunya hara 2020-11-4
下のようなプルグラムを実行したところ、「エラー: fit>iFit (line 348)
Inf がモデル関数で計算されました。近似を続けることはできません。
係数の上限と下限を使用するか、範囲を狭めてみてください。
エラー: fit (line 116)
[fitobj, goodness, output, convmsg] = iFit( xdatain, ydatain, fittypeobj, ...」
というエラー文が出てきました。関数に範囲は設定してあるのですがどのようにしたらこのエラーを解消できますか?
for n = 1:2048;
for m = 1:2048;
[xData, yData] = prepareCurveData( [], C(n,m,1:195) );
% 近似タイプとオプションを設定します。
ft = fittype( 'gauss1' );
opts = fitoptions( 'Method', 'NonlinearLeastSquares' );
opts.Display = 'Off';
opts.Lower = [-Inf -Inf 0];
opts.StartPoint = [3091 178 160.226378472824];
% モデルをデータに近似します。
c = fit( xData, yData, ft, opts );
b=coeffvalues(c);
l=b(1,1);
k=b(1,2);
if 10000<l<30000;
B(n,m,1)=k;
else
B(n,m,1)=0;
end
end
end

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Curve Fitting Toolbox 入門 的更多信息

产品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!