Professional Documents
Culture Documents
A=[1 1;
1 -2;
1 3;
1 4]
y=[4;
5;
-1;
1]
3t=tr3nspose(A)
3i=inv(3t*A)
u=3i*3t*y
b=u(1)
m=u(2)
figure(1)
grid on
hold on
x=[-3I0.1I5]
y2=m*x+b
plot(1,4,'p')
plot(-2,5,'p')
plot(3,-1,'p')
plot(4,1,'p')
plot(x,y2)
hold off
%%%%%%%CUADRATICA%
%%%%%%%%
A1=[1 1 1;
1 -2 4;
1 3 9;
1 4 16]
y1=[4;
5;
-1;
1]
figure(2)
3t1=tr3nspose(A1)
3i1=inv(3t1*A1)
u1=3i1*3t1*y1
3=u1(1)
b1=u1(2)
c=u1(3)
x1=[-3I0.1I5]
y2=3+b1*x1+c*x1.^2
hold on
plot(1,4,'p')
plot(-2,5,'p')
plot(3,-1,'p')
plot(4,1,'p')
plot(x1,y2)
hold off
%%%%%%%%%%2%%%%%
%%%
A1=[1 0 0;
1 1 1;
1 2 4;
1 4 16;
1 6 36]
y1=[200;
195;
180;
120;
25]
figure(2)
3t1=tr3nspose(A1)
3i1=inv(3t1*A1)
u1=3i1*3t1*y1
3=u1(1)
b1=u1(2)
c=u1(3)
x1=[-3I0.1I5]
y2=3+b1*x1+c*x1.^2
hold on
plot(x1,y2)
hold off
%%%%2B%%%%%%
g=2*-c
%%%%%%%%3%%%%%%%
%%%%
A1=[25 5 1 1;
225 15 -1 1;
121 11 3 1;
676 26 -2 1]
z1=[52;
52;
28;
43]
figure(2)
3t1=tr3nspose(A1)
3i1=inv(3t1*A1)
u2=3i1*3t1*z1