Using tabular data for Curve fitting of function z = f (x, y) with incomplete values of z. These blank z (i, j) automatically takes zero values and this is a problem
2 ビュー (過去 30 日間)
古いコメントを表示
Dear Community Members,
I have tabular data for data selection in the Curve fitter in the form of:.
I have to use curve fitter for z = f (x, y), but I don't have values for z(2, 4), z(3,3) and z(3,4) (red one).
In the workspase variable (matrix Z) these blank places automatically take values, which is zeros. Is there any instrument to ignore these zeros and the regression analyses to be made only with the available z values. In other words to ignore the three zero values in the down right corner? May be something with the weights instrument? If I simply use the matrix with zero values, without any additional actions, of course the regression method uses these z(2, 4) = 0, z(3,3) = 0 and z(3,4) = 0 and the results are unacceptable.
2 件のコメント
Torsten
2024 年 9 月 23 日
Supply z as a vector instead of a matrix and don't list these three data points in the vector. What's the problem ?
採用された回答
Torsten
2024 年 9 月 25 日
編集済み: Torsten
2024 年 9 月 25 日
green = [5 5 5 5 5 4 4 4 4 1 1 1];
blue = [5 10 15 20 25 5 10 15 20 5 10 15];
yellow = [455 322 261 205 169 410 306 246 191 257 185 151];
F = @(p) fun(p,green,blue,yellow);
p0 = [1 1 1 1];
p = lsqnonlin(F,p0);
F(p)
norm(F(p))
a = p(1)
n = p(2)
b = p(3)
m = -p(4)/2
function res = fun(p,green,blue,yellow)
a = p(1);
n = p(2);
b = p(3);
m = p(4);
res = yellow - a*blue.^n.*((green+b).^2).^m;
end
0 件のコメント
その他の回答 (1 件)
Cris LaPierre
2024 年 9 月 25 日
I'd suggest using the standardizeMissing function to convert the 0 values to nan. The Curve Fitter app will ignore NANs.
参考
カテゴリ
Help Center および File Exchange で Linear and Nonlinear Regression についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!