format compact
a=[1 -4 3 -2]
a =
1 -4 3 -2
roots(a)
ans =
3.2695 + 0.0000i
0.3652 + 0.6916i
0.3652 - 0.6916i
x=roots(a)
x =
3.2695 + 0.0000i
0.3652 + 0.6916i
0.3652 - 0.6916i
plot(x,'o')
grid
compass(x)
abs(x)
ans =
3.2695
0.7821
0.7821
angle(x)
ans =
0
1.0849
-1.0849
angle(x)*180/pi
ans =
0
62.1615
-62.1615
b=[-1,0,-6,0,1,3,0,0]
b =
Columns 1 through 6
-1 0 -6 0 1 3
Columns 7 through 8
0 0
b=[-1,0,-6,0,1,3,0,0]
b =
Columns 1 through 6
-1 0 -6 0 1 3
Columns 7 through 8
0 0
roots(b)
ans =
0.0000 + 0.0000i
0.0000 + 0.0000i
0.0383 + 2.4844i
0.0383 - 2.4844i
0.8304 + 0.0000i
-0.4535 + 0.6160i
-0.4535 - 0.6160i
plot(ans,'o')
format long e
roots(b)
ans =
0.000000000000000e+00 + 0.000000000000000e+00i
0.000000000000000e+00 + 0.000000000000000e+00i
3.831030889283532e-02 + 2.484432805759941e+00i
3.831030889283532e-02 - 2.484432805759941e+00i
8.303899476123050e-01 + 0.000000000000000e+00i
-4.535052826989876e-01 + 6.160374074801960e-01i
-4.535052826989876e-01 - 6.160374074801960e-01i
t=[-4:4];
b
b =
Columns 1 through 6
-1 0 -6 0 1 3
Columns 7 through 8
0 0
polyval(b,t)
ans =
Columns 1 through 3
22512 3645 324
Columns 4 through 6
9 0 -3
Columns 7 through 9
-300 -3591 -22416
plot(t,polyval(b,t),'r*')
tj=linspace(-4,4,1000);
plot(tj,polyval(b,tj))
x=roots(b)
x =
0.000000000000000e+00 + 0.000000000000000e+00i
0.000000000000000e+00 + 0.000000000000000e+00i
3.831030889283532e-02 + 2.484432805759941e+00i
3.831030889283532e-02 - 2.484432805759941e+00i
8.303899476123050e-01 + 0.000000000000000e+00i
-4.535052826989876e-01 + 6.160374074801960e-01i
-4.535052826989876e-01 - 6.160374074801960e-01i
poly(x)
ans =
Column 1
1.000000000000000e+00
Column 2
-4.440892098500626e-16
Column 3
5.999999999999998e+00
Column 4
-3.108624468950438e-15
Column 5
-1.000000000000004e+00
Column 6
-2.999999999999993e+00
Column 7
0
Column 8
0
format
poly(x)
ans =
Columns 1 through 4
1.0000 -0.0000 6.0000 -0.0000
Columns 5 through 8
-1.0000 -3.0000 0 0
a
a =
1 -4 3 -2
b
b =
Columns 1 through 6
-1 0 -6 0 1 3
Columns 7 through 8
0 0
c=conv(a,b)
c =
Columns 1 through 6
-1 4 -9 26 -17 11
Columns 7 through 11
-9 7 -6 0 0
deconv(c,b)
ans =
1 -4 3 -2
[v,z]=deconv(c,b)
v =
1 -4 3 -2
z =
Columns 1 through 6
0 0 0 0 0 0
Columns 7 through 11
0 0 0 0 0
prolozeni
prolozeni
koeficienty
0.0571 -1.1955 8.8070 2.2071
prolozeni
koeficienty
-0.4250 5.8679 5.0321
prolozeni
[Warning: Polynomial is not unique; degree
>= number of data points.]
[> In polyfit (line 74)
In prolozeni (line 8)]
koeficienty
Columns 1 through 4
-0.0001 0.0055 -0.0912 0.7441
Columns 5 through 8
-3.0665 5.3717 0 -4.5898
Column 9
11.6263
stupenPol
Zadej stupen polynomu: 80
Zadej stupen polynomu: -1
Zadej stupen polynomu: 3
stupenPol
Zadej stupen polynomu: 4
VAchar
koeficienty
-0.0001 0.0076 0.0356 -0.0404
VAchar
koeficienty
-0.0010 0.2946 -1.2424