blob: 578cc3880654b2e83f9edb3201258c0567386fdb (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
//Example No. 10_05
//Plane Fitting
//Pg No. 342
clear ; close ; clc ;
x = 1:4
z = 0:3
y = 12:6:30
n = length(x) //Number of data points
m = 3 //Number of unknowns
G = [ ones(1,n) ; x ; z]
H = G'
C = G*H
B = y*H
D = C\B'
disp(C,B)
disp(D)
mprintf('\n The regression plane is \n y = %i + %f*x + %i*z ',D(1),D(2),D(3))
|