How to use regression to find equation of data set?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Jenifer NG
el 3 de Nov. de 2022
Comentada: Jenifer NG
el 6 de Nov. de 2022
Dear All,
I would like to ask for some help.
I am trying to find the equation present my data.
But io stuck when use regression method.
could someone help me?
i assume my equation is:
z = a*x^n +b*y+c
Thanks so much!
Han
x = [12 12.5 13 13.5 14
]
y = [61 61.5 62 62.5 63
]
z = [120 114 103 93 80
124 120 109 97 85
128 121 113 101 88
130 125 116 105 92
134 128 119 109 96
]
surf(x,y,z)
0 comentarios
Respuesta aceptada
KSSV
el 3 de Nov. de 2022
x = [12 12.5 13 13.5 14] ;
y = [61 61.5 62 62.5 63] ;
[X,Y] = meshgrid(x,y) ;
Z = [120 114 103 93 80
124 120 109 97 85
128 121 113 101 88
130 125 116 105 92
134 128 119 109 96] ;
x = X(:) ;
y = Y(:) ;
z = Z(:) ;
sf = fit([x, y],z,'poly22')
plot(sf,[x y],z)
5 comentarios
KSSV
el 5 de Nov. de 2022
x = [12 12.5 13 13.5 14] ;
y = [61 61.5 62 62.5 63] ;
[X,Y] = meshgrid(x,y) ;
Z = [120 114 103 93 80
124 120 109 97 85
128 121 113 101 88
130 125 116 105 92
134 128 119 109 96] ;
x = X(:) ;
y = Y(:) ;
z = Z(:) ;
sf = fit([x, y],z,'poly22')
zi = sf(x,y) ;
figure
hold on
surf(X,Y,Z)
plot3(x,y,zi,'*b')
view(3)
Más respuestas (0)
Ver también
Categorías
Más información sobre Get Started with Curve Fitting Toolbox en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!