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 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Torsten
le 23 Sep 2024
Supply z as a vector instead of a matrix and don't list these three data points in the vector. What's the problem ?
Réponse acceptée
Torsten
le 25 Sep 2024
Modifié(e) : Torsten
le 25 Sep 2024
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 commentaires
Plus de réponses (1)
Cris LaPierre
le 25 Sep 2024
I'd suggest using the standardizeMissing function to convert the 0 values to nan. The Curve Fitter app will ignore NANs.
Voir également
Catégories
En savoir plus sur Linear and Nonlinear Regression dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!