近似でエラーが発生しました。どなたか解消方法を教えていただきたいです。
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
下のようなプルグラムを実行したところ、「エラー: 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 Kommentare
Antworten (0)
Siehe auch
Kategorien
Mehr zu Curve Fitting Toolbox 入門 finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!