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!