How to use regression to find equation of data set?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Jenifer NG
am 3 Nov. 2022
Kommentiert: Jenifer NG
am 6 Nov. 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 Kommentare
Akzeptierte Antwort
KSSV
am 3 Nov. 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 Kommentare
KSSV
am 5 Nov. 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)
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Get Started with Curve Fitting Toolbox finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!