0% found this document useful (0 votes)
15 views29 pages

Mate Ex Final

Uploaded by

Dani Corduneanu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views29 pages

Mate Ex Final

Uploaded by

Dani Corduneanu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 29

>> a=[1,1;2,-1];

>> I=[1,0;0,1];
>> B=[3;3];
>> M=[a,I,B]

M =

1 1 1 0 3
2 -1 0 1 3

>> T1=[1,0;-2,1];
>> M1=T1*M

M1 =

1 1 1 0 3
0 -3 -2 1 -3

>> T2=[1,0;0,-1/3];
>> M2=T2*M1

M2 =

1.0000 1.0000 1.0000 0 3.0000


0 1.0000 0.6667 -0.3333 1.0000

>> T3=[1,-1;0,1];
>> M3=T3*M2

M3 =

1.0000 0 0.3333 0.3333 2.0000


0 1.0000 0.6667 -0.3333 1.0000
Ex 2
>> a=[1,1;3,-1];
>> b=[2;6];
>> i=[1,0;0,1];
>> m=[a,i,b]

m =

1 1 1 0 2
3 -1 0 1 6

>> t1=[1,0;-3,1];
>> m1=t1*m

m1 =1 1 1 0 2
0 -4 -3 1 0
>> t2=[1,0;0,-1/4];
>> m2=t2*m1
m2 = 1.0000 1.0000 1.0000 0 2.0000
0 1.0000 0.7500 -0.2500 0
>> t3=[1,-1;0,1];
>> m3=t3*m2

m3 =

1.0000 0 0.2500 0.2500 2.0000


0 1.0000 0.7500 -0.2500 0

Ex 3
>> a=[2,1;3,-2];
>> b=[5;4];
>> i2=[1,0;0,1];
>> m=[a,i2,b]

m =

2 1 1 0
5
3 -2 0 1
4

>> t1=[1/2,0;0,1];
>> m1=t1*m
m1 =

1.0000 0.5000
0.5000 0 2.5000
3.0000 -2.0000
0 1.0000 4.0000

>> t2=[1,0;-3,1];
>> m2=t2*m1

m2 =

1.0000 0.5000
0.5000 0 2.5000
0 -3.5000 -
1.5000 1.0000 -3.5000
>> t3=[1,0;0,-2/7];
>> m3=t3*m2

m3 =

1.0000 0.5000
0.5000 0 2.5000
0 1.0000
0.4286 -0.2857 1.0000

>> t4=[1,-1/2;0,1];
>> m4=t4*m3

m4 =

1.0000 0
0.2857 0.1429 2.0000
0 1.0000
0.4286 -0.2857 1.0000

Ex 4
>> a=[1 1 1;0 1 2;-1 1 1];
>> b=[3;1;0];
>> inv(a)

ans =

0.5000 0 -
0.5000
1.0000 -1.0000
1.0000
-0.5000 1.0000 -
0.5000
>> inv(a)*b

ans =

1.5000
2.0000
-0.5000

Hamilton
>> a=[2 1 3;1 1 0;3 2 1];
>> i3=[1 0 0;0 1 0;0 0 1];
>> syms x;
>> d=a-x*i3

d =
[2 - x, 1, 3]
[ 1, 1 - x, 0]
[ 3, 2, 1 - x]

>> eq=det(d)==0

eq =

- x^3 + 4*x^2 + 5*x - 2 == 0

>> - a^3 + 4*a^2 + 5*a - 2*i3

ans =

0 0 0
0 0 0
0 0 0

>> a1=1/2*(-a^2+4*a+5*i3)

a1 =

-0.5000 -2.5000 1.5000


0.5000 3.5000 -1.5000
0.5000 0.5000 -0.5000

>> inv(a)

ans =

-0.5000 -2.5000 1.5000


0.5000 3.5000 -1.5000
0.5000 0.5000 -0.5000

Ex 2
>> a=[4 1 2;0 1 1;2 2 1];
>> i3=[1 0 0;0 1 0;0 0 1];
>> syms x;
>> d=a-x*i3

d =

[4 - x, 1, 2]
[ 0, 1 - x, 1]
[ 2, 2, 1 - x]

>> eq=det(d)==0
eq =

- x^3 + 6*x^2 - 3*x - 6 == 0

>> - a^3 + 6*a^2 - 3*a - 6 ;


>> a1=1/6*(-a^2+6*a-3*i3)

a1 =

0.1667 -0.5000 0.1667


-0.3333 0 0.6667
0.3333 1.0000 -0.6667

>> inv(a)

ans =

0.1667 -0.5000 0.1667


-0.3333 0 0.6667
0.3333 1.0000 -0.6667
Dereapta de
regresie
>> e1=[1;1;1];
>> x=[0;1;2];
>> y=[0;2;3];
>> a=[e1,x]

a =

1 0
1 1
1 2

>> at=a'

at =

1 1 1
0 1 2

>> v=inv(at*a)*at*y
v =

0.1667
1.5000

Ex 2

>> e=[1;1;1;1];
>> x=[1;-1;2;0];
>> y=[0;2;7;-2];
>> a=[e,x]

a =

1 1
1 -1
1 2
1 0

>> at=a'
at =

1 1 1 1
1 -1 2 0

>> v=inv(at*a)*at*y

v =

0.9000
1.7000

Ex3

>> e=[1;1;1;1;1];
>> x=[0;2;5;8;10];
>> y=[0;1;3;5;6];
>> a=[e,x]

a =
1 0
1 2
1 5
1 8
1 10

>> at=a'

at =

1 1 1 1 1
0 2 5 8 10
>> v=inv(at*a)*at*y

v =

-0.0882
0.6176

Ex4
>> e=[1;1;1;1;1];
>> x=[-2;0;1;1;2];
>> y=[2;1;1;3;2];
>> a=[e,x]
a =
1 -2
1 0
1 1
1 1
1 2
>> at=a'
at =
1 1 1 1 1
-2 0 1 1 2
>> v=inv(at*a)*at*y
v =
1.7826
0.0435

Ex5
>> a=[1 1 2;1 2 1;2 1 1;3 -1 5];
>> b=[6;5;5;10];
>> r=rank(a)
r = 3
>> at=a'
at =
1 1 2 3
1 2 1 -1
2 1 1 5
>> x0=inv(at*a)*at*b
x0 =
0.9215
1.3082
1.7281
Hamilton
>> a=[2 1 4;1 2 3;-2 4 1];
>> i3=[1 0 0; 0 1 0;0 0 1];
>> syms x;
>> eq=det(a-x*i3)==0

eq =

- x^3 + 5*x^2 - 3*x + 5 == 0

>> - a^3 + 5*a^2 - 3*a + 5*i3

ans =
0 0 0
0 0 0
0 0 0

>> a1=-1/5*(-a^2+5*a-3*i3)

a1 =

-2.0000 3.0000 -1.0000


-1.4000 2.0000 -0.4000
1.6000 -2.0000 0.6000

>> %verificare
>> inv(a)

ans =

-2.0000 3.0000 -1.0000


-1.4000 2.0000 -0.4000
1.6000 -2.0000 0.6000

Rtc
>> a=[2,1;5,3];
>> i=[1,0;0,1];
>> b=[5;13];
>> m=[a,i,b]

m =

2 1 1
0 5
5 3 0
1 13

>> t1=[1/2,0;0,1];
>> m1=t1*m

m1 =

1.0000 0.5000
0.5000 0
2.5000
5.0000 3.0000
0 1.0000
13.0000

>> t2=[1,0;-5,1];
>> m2=t2*m1
m2 =

1.0000 0.5000
0.5000 0
2.5000
0 0.5000
-2.5000 1.0000
0.5000

>> t3=[1,0;0,2];
>> m3=t3*m2

m3 =
1.0000 0.5000
0.5000 0
2.5000
0 1.0000
-5.0000 2.0000
1.0000

>> t4=[1,-1/2;0,1];
>> m4=t4*m3

m4 =

1 0 3
-1 2
0 1 -5
2 1
Ex 3
>> e=[1;1;1;1;1];
>> x=[1;4;2;-1;3];
>> b=[3;-2;4;1;2];
>> a=[e,x];
>> a=[e,x]

a =

1 1
1 4
1 2
1 -1
1 3

>> v=inv(a'*a)*a'*y

v =
2.3784
-0.4324

>> %verificare
>> a\b

ans =

2.3784
-0.4324

Ex4 sist supra dim


>> a=[1,1;2,-1;4,5];
>> b=[3;3;10];
>> syms x;
>> x=inv(a'*a)*a'*b

x = 1.8107
0.5777
>> v1=[2;1;-2];
>> v2=[1;3;2];
>> s=[v1,v2];
>> rank(s)
ans = 2
ex2

>> m1=[1,0,0];
>> m2=[2,1,3];
>> m3=2*m2-m1

m3 = 3 2 6

>> syms x y z;
>> m1=[1,1,2];
>> eqp=x+2*y+3*z+1==0;
>> eq1=(x-1)/1==(y-1)/2;
>> eq2=(y-1)/2==(z-2)/3;
>> eqs=[eqp;eq1;eq2];
>> solve(eqs,x,y,z)

ans =
struct with fields:
x: 2/7
y: -3/7
z: -1/7
>> m2=[2/7,-3/7,-1/7];
>> m3=2*m2-m
m3 =
-0.4286 -1.8571 -2.2857

Ex nou

>> syms x y z;
>> m1=[1,-1,0];
>> eq1=(x-2)/(-3)==(y+1)/2;
>> eq2=(y+1)/2==(z+1)/3;
>> eqp=-3*x+2*y+3*z+5==0;
>> eqs=[eqp;eq1;eq2];
>> solve(eqs,x,y,z)

ans =

struct with fields:

x: 13/11
y: -5/11
z: -2/11

>> mi=[13/11,-5/11,-2/11];
>> ms=2*mi-m1

ms =

1.3636 0.0909 -0.3636

Ec plan

>> syms x y z x1 y1 z1 x2 y2 z2 x3 y3 z3;


>> A=[x-x1 y-y1 z-z1;x2-x1 y2-y1 z2-
z1;x3-x1 y3-y1 z3-z1]
A =
[ x - x1, y - y1, z - z1]
[x2 - x1, y2 - y1, z2 - z1]
[x3 - x1, y3 - y1, z3 - z1]

>> d=det(A)

d =
x*y1*z2 - x*y2*z1 - x1*y*z2 + x1*y2*z +
x2*y*z1 - x2*y1*z - x*y1*z3 + x*y3*z1 +
x1*y*z3 - x1*y3*z - x3*y*z1 + x3*y1*z +
x*y2*z3 - x*y3*z2 - x2*y*z3 + x2*y3*z +
x3*y*z2 - x3*y2*z - x1*y2*z3 + x1*y3*z2 +
x2*y1*z3 - x2*y3*z1 - x3*y1*z2 + x3*y2*z1

>> d1=subs(d,{x1,y1,z1},{1,0,0});
>> d2=subs(d1,{x2,y2,z2},{2,1,3});
>> d3=subs(d2,{x3,y3,z3},{1,1,0})
d3 = z - 3*x + 3
>> % ec plan
>> eq=d3==0

eq = z - 3*x + 3 == 0

>> syms x y;
>> f=(x^2+y^2)/(x+y);
>> fx=diff(f,x);
>> fy=diff(f,y);
>> E=x*fx+y*fy
E =
- x*((x^2 + y^2)/(x + y)^2 - (2*x)/(x +
y)) - y*((x^2 + y^2)/(x + y)^2 - (2*y)/(x
+ y))
>> simplify(E)
ans =
(x^2 + y^2)/(x + y)
>> % Teoreme este ferificat

Gradient
>> syms x y i j;
>> f=x^2+y^2;
>> fx=diff(f,x);
>> fy=diff(f,y);
>> gf=fx*i+fy*j;
>> subs(gf,[x,y],[2,1])
ans = 4*i + 2*j

derivate dupa diresctie


>> syms x y;
>> f=x^3+y^2+x*y;
>> u1=0,6;
u1 =

>> u1=0.6;
>> u2=0.8;
>> df=u1*diff(f,x)+u2*diff(f,y);
>> df0=subs(df,[x,y],[2,3])

df0 =

77/5

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy