Vous êtes sur la page 1sur 16

>> A=[1 3 4;6 7 8;8 9 3]

A=

>> B=[1 2 3]

B=

>> C=[1;4;8]

C=

4
8

>> a=1;b=4;c=13;
>> x1=(-b+sqrt(b^2-4*a*c))/(2*a)

x1 =

-2.0000 + 3.0000i

>> x2=(-b+sqrt(b^2-4*a*c))/(2*a)

x2 =

-2.0000 + 3.0000i

>> x2=(-b-sqrt(b^2-4*a*c))/(2*a)

x2 =

-2.0000 - 3.0000i

>> p=[2 7 1]

p=

>> q=[1 0 3 0]

q=

>> p=[1 5 8 1]

p=

>> polyval(p,2)

ans =

45

>> p=[1 -3 9 13]

p=

-3

13

>> roots(p)

ans =

2.0000 + 3.0000i
2.0000 - 3.0000i
-1.0000 + 0.0000i

>> p1=[1 -2 1];p2=[1 1];


>> conv(p1,p2)

ans =

-1

-1

>> [c,r]=deconv(p1,p2)

c=

-3

r=

>> t=[0:0.5:4]

t=

0
4.0000

0.5000

1.0000

1.5000

>> k=10 ; v1=[1 2 3]; v2=[4 5 6];


>> k*v1

ans =

10

20

30

>> v1+v2

ans =

2.0000

2.5000

3.0000

3.5000

>> v1*v2
Error using *
Inner matrix dimensions must agree.

>> v1.*v2

ans =

10

18

>> t=[0:0.1:10];
>> y=10*exp(-t).*sin(5*t) ;
>> plot(t,y)
>> grid
>> xlabel(' tiempo(s)')
>> ylabel(' y(t) ')
>> title('Senoide amortiguada')
>> plot(t,y,'r')
>> grid
>> plot(t,y,'r *')
>> fplot('10*exp(-t).*sin(5*t)',[0,10])
>> grid
>> xlabel(' tiempo(s)')
>> ylabel(' y(t) ')
>> title('Senoide amortiguada')
>> t=[0:pi/180:4*pi];
>> y1=sin(t) ;
>> y2=cos(t) ;
>> plot(t,y1,'r o',t,y2, 'g -')
>> t=0:0.1.10;
t=0:0.1.10;

|
Error: Unexpected MATLAB expression.

>> t=0:0.1:10;
>> subplot(2,2,1)
>> y1=exp(-t) ;
>> plot(t,y1)
>> subplot82,2,2)
subplot82,2,2)
|
Error: Unbalanced or unexpected parenthesis or bracket.

>> subplot(2,2,2)
>> y2=t.*exp(-t)

y2 =

Columns 1 through 9

0
0.3595

0.0905

0.1637

0.2222

0.2681

0.3033

0.3293

0.3476

Columns 10 through 18

0.3659
0.3106

0.3679

0.3662

0.3614

0.3543

0.3452

0.3347

0.3230

0.2572

0.2438

0.2306

0.2177

0.2052

Columns 19 through 27

0.2975
0.1931

0.2842

0.2707

Columns 28 through 36

0.1815
0.1057

0.1703

0.1596

0.1494

0.1397

0.1304

0.1217

0.1135

0.0789

0.0733

0.0679

0.0630

0.0583

0.0395

0.0365

0.0337

0.0311

0.0287

0.0191

0.0176

0.0162

0.0149

0.0137

0.0090

0.0082

0.0076

0.0070

0.0064

0.0041

0.0038

0.0035

0.0032

0.0029

0.0019

0.0017

0.0016

0.0014

0.0013

Columns 37 through 45

0.0984
0.0540

0.0915

0.0850

Columns 46 through 54

0.0500
0.0265

0.0462

0.0427

Columns 55 through 63

0.0244
0.0126

0.0225

0.0207

Columns 64 through 72

0.0116
0.0059

0.0106

0.0098

Columns 73 through 81

0.0054
0.0027

0.0049

0.0045

Columns 82 through 90

0.0025
0.0012

0.0023

0.0021

Columns 91 through 99

0.0011
0.0005

0.0010

0.0009

Columns 100 through 101

0.0005

0.0005

>> y2=t.*exp(-t) ;
>> plot(t,y2)
>> subplot(2,2,3)
>> y3=exp(-t).*cos(t) ;
>> plot(t,y3)
>> subplot(2,2,4)
>> y4=exp(t).*cos(t) ;
>> plot(t,y4)
>>

0.0009

0.0008

0.0007

0.0007

0.0006

Vous aimerez peut-être aussi