You are on page 1of 3

>> x=-3:0.

25:3;
>> x

x =

Columns 1 through 13

-3.0000 -2.7500 -2.5000 -2.2500 -2.0000 -1.7500 -1.5000 -1.2500


-1.0000 -0.7500 -0.5000 -0.2500 0

Columns 14 through 25

0.2500 0.5000 0.7500 1.0000 1.2500 1.5000 1.7500 2.0000


2.2500 2.5000 2.7500 3.0000

>> x=x'

x =

-3.0000
-2.7500
-2.5000
-2.2500
-2.0000
-1.7500
-1.5000
-1.2500
-1.0000
-0.7500
-0.5000
-0.2500
0
0.2500
0.5000
0.7500
1.0000
1.2500
1.5000
1.7500
2.0000
2.2500
2.5000
2.7500
3.0000

>> y=(13-7*x)/4

y =

8.5000
8.0625
7.6250
7.1875
6.7500
6.3125
5.8750
5.4375
5.0000
4.5625
4.1250
3.6875
3.2500
2.8125
2.3750
1.9375
1.5000
1.0625
0.6250
0.1875
-0.2500
-0.6875
-1.1250
-1.5625
-2.0000

>> plot(x,y)
>> xlabel('Eje x')
>> ylabel('eje y')
>> title('sistema de ec lin con 2 incognitas')
>> title('Sistema de ec lin con 2 incognitas')
>>
-------------------------------------------ejercicio
3----------------------------------------------------------------------------------
-----

ejercicio2
>> x=linspace(-20,20,40);
>> y=(13-7*x)/2;
>> y1=(5*x-19)/2;
>> plot(x,y)
>> hold on
>> plot(x,y1)
>> grid on
>> A=[100 200,300 400]

A =

100 200 300 400

>> A=[100 200;300 400]

A =

100 200
300 400

>> A=[7 4;5 -2]

A =

7 4
5 -2

>> A_inversa=inv(A);
>> b=[13;19]

b =
13
19

>> solucion=A_inersa*b
Unrecognized function or variable 'A_inersa'.

Did you mean:


>> solucion=A_inversa*b

solucion =

3.0000
-2.0000

>> B=[1 1 1;2 -1 -1;1 2 -1]

B =

1 1 1
2 -1 -1
1 2 -1

>> B=[1 1 1;2 -1 1;1 2 -1]

B =

1 1 1
2 -1 1
1 2 -1

>> b1=[12;7;6]

b1 =

12
7
6

>> inversa_B=inv(B)

inversa_B =

-0.1429 0.4286 0.2857


0.4286 -0.2857 0.1429
0.7143 -0.1429 -0.4286

>> sol=inversa_B*b1

sol =

3.0000
4.0000
5.0000

You might also like