Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

Amine Bouabbeche 30/10/2023

TPN2

• H/W 1: Consider a matrix

1- >> n=[1 2 1579, 5 7 73, 578 38 9]

n=

1 2 1579 5 7 73 578 38 9

2- >> n=[1 2 1579; 5 7 73; 578 38 9]

n=

1 2 1579
5 7 73
578 38 9

3- >> N=n'

N=

1 5 578
2 7 38
1579 73 9
4- >> det(n)

ans =

-6.0070e+06

5- >> inv(n)

ans =

0.0005 -0.0100 0.0018


-0.0070 0.1519 -0.0013
0.0006 -0.0002 0.0000

6- >> n*ans

ans =

1.0000 0.0000 -0.0000


0.0000 1.0000 -0.0000
0.0000 -0.0000 1.0000

7- >> n

n=

1 2 1579
5 7 73
578 38 9
8- >> b=[2;-3;4]

b=

2
-3
4
9- >> x=n\b

x=

0.0381
-0.4750
0.0018

• H/W2: Use MATLAB commands to get exactly as the figure shown below ,where
>> plot(x,y,'+:b', 'linewidth', 2, 'MarkerSpacing', 10)
>> hold off
>> plot(x,z,'r-', 'linewidth', 2)
>> title('Sin and Cos Curves')
>> xlabel('Angle')
>> ylabel('Value')
>> legend('Sin(x)', 'Cos(x)')
>> axis([0 2*pi -1 1])

You might also like