Professional Documents
Culture Documents
??? p(x)=x^3+2x^2+3x+4
|
Error: Unexpected MATLAB expression.
>> %p(x)=x^3+2x^2+3x+4
>> p=[1 2 3 4]
p=
>> roots(p)
ans =
-1.6506
-0.1747 + 1.5469i
-0.1747 - 1.5469i
r=
1.0000
>> poly(r)
ans =
-5
10 -10
>> p2=poly(r)
p2 =
-5
10 -10
>> poly2sym8p2)
??? poly2sym8p2)
|
Error: Unbalanced or unexpected parenthesis or bracket.
>> poly2sym(p2)
ans =
>> px=poly2sym(p2)
px =
>> sym2poly(px)
ans =
-5
10 -10
>> pretty(px)
x - 5 x + 10 x - 10 x + 4
>> pq=conv(p,q)
??? Undefined function or variable 'q'.
>> q=[1 0 0 2 3]
q=
>> pq=conv(p,q)
pq =
>> [g j]=deconv(p,q)
g=
j=
>> [g h]=deconv(q,p)
g=
-2
h=
11
12
17
12
>> pr=polyval(p,2)
pr =
26
ps =
58 194 668
>> d=polyder(p)
d=
>> i=polyint(p)
i=
0.2500
>> diff(px)
ans =
0.6667
1.5000
4.0000
>> f=e^-x - x;
??? Undefined function or variable 'e'.
>> f=exp(-x)-x
??? Undefined function or variable 'x'.
>> f=exp(-'x')-'x';
>> f=exp(-'x')-'x'
f=
-120
>> f=exp(-x)-x
??? Undefined function or variable 'x'.
>>
>> f=exp(-x)-x
??? Undefined function or variable 'x'.
>> symsx
??? Undefined function or variable 'symsx'.
>> syms(x)
??? Undefined function or variable 'x'.
>> sym(x)
??? Undefined function or variable 'x'.
>> symx
??? Undefined function or variable 'symx'.
>> sym x
ans =
>> f=exp(-x)-x
??? Undefined function or variable 'x'.
>> f=exp(-x)-x;diff(f)
??? Undefined function or variable 'x'.
>> sym x
ans =
>> u=exp(-x)-x
??? Undefined function or variable 'x'.
>> syms x
>> u=exp(-x)-x
u=
1/exp(x) - x
>> diff(u)
ans =
- 1/exp(x) - 1
>> int(u)
ans =
- 1/exp(x) - x^2/2
>> e=feval(u,5)
??? Error using ==> feval
Argument must contain a string or function_handle.
>> f=inline(f)
>> F=inline(F)
??? Undefined function or variable 'F'.
>> F=inline(F)
??? Undefined function or variable 'F'.
>> F=inline(u)
F=
Inline function:
F(x) = 1./exp(x) - x
>> e=Feval(u,5)
??? Undefined function or method 'Feval' for input arguments of type 'sym'.
>> e=Feval(F,5)
Warning: Could not find an exact (case-sensitive) match for 'Feval'.
C:\Archivos de
programa\MATLAB\R2008b\toolbox\matlab\funfun\@inline\feval.m is a
case-insensitive match and will be used instead.
e=
-4.9933
>> sub(u,5)
??? Undefined function or method 'sub' for input arguments of type 'sym'.
>> sub(F,5)
??? Undefined function or method 'sub' for input arguments of type 'inline'.
>> E=sub(u,5)
??? Undefined function or method 'sub' for input arguments of type 'sym'.
>> syms x
>> E=sub(u,5)
??? Undefined function or method 'sub' for input arguments of type 'sym'.
>> syms u
>> E=sub(u,5)
??? Undefined function or method 'sub' for input arguments of type 'sym'.
>> syms x
>> E=sub(u,5)
??? Undefined function or method 'sub' for input arguments of type 'sym'.
>> syms x
>> E=sub(u,5)
??? Undefined function or method 'sub' for input arguments of type 'sym'.
>> E=sub(F,5)
??? Undefined function or method 'sub' for input arguments of type 'inline'.
>> E=subs(u,5)
E=
x=
y=
12
15
>> p3=polyfit(x,y,3)
p3 =
>> plot(x,y)
>> plot(x,y)
>> interp1(x,y,linear)
>> interp1(x,y,'linear')
ans =
>> interp1(x,y,'cubic')
ans =
>> interp1(x,y,'cubic')
ans =
>> interp1(x,y,'spline')
ans =
1.0e+003 *
0.1720
0.2100
0.3580
0.9700
2.3020
>> p3(10)
??? Attempted to access p3(10); index out of bounds because numel(p3)=4.
>> polival(p3)
??? Undefined function or method 'polival' for input arguments of type
'double'.
>> poliyval(p3)
??? Undefined function or method 'poliyval' for input arguments of type
'double'.
>> poliyval(pxx,10)
??? Undefined function or variable 'pxx'.
>> poliyval(px,10)
??? Undefined function or method 'poliyval' for input arguments of type
'sym'.
>> poliyval(p3,10)
>> polyval(pxx,10)
??? Undefined function or variable 'pxx'.
>> polyval(p3,10)
ans =
-382.0312
>> ps=polyfit(y,x,3)
ps =
>> polyval(ps,10)
ans =
163.6549
>> figure(1)
>> figure(1)=plot(x,y)
figure =
171.0034
>> interp1(x,y,10,'cubic')
ans =
15.0681
>> interp1(y,x,10,'cubic')
ans =
163.6255
>> interp1(y,x,10,'spline')
ans =
164.9568
x=
12
15
y=
>> xx=5:0.
xx =
>> xx=5:0.1:15;
>> xx=5:0.1:15
xx =
Columns 1 through 9
5.0000
5.8000
5.1000
5.2000
5.3000
5.4000
5.5000
5.6000
5.7000
6.2000
6.3000
6.4000
6.5000
6.6000
7.1000
7.2000
7.3000
7.4000
7.5000
Columns 10 through 18
5.9000
6.7000
6.0000
6.1000
Columns 19 through 27
6.8000
7.6000
6.9000
7.0000
Columns 28 through 36
7.7000
8.5000
7.8000
7.9000
8.0000
8.1000
8.2000
8.3000
8.4000
8.9000
9.0000
9.1000
9.2000
9.3000
9.8000
Columns 37 through 45
8.6000
9.4000
8.7000
8.8000
Columns 46 through 54
9.5000 9.6000
10.2000 10.3000
9.7000
Columns 55 through 63
Columns 64 through 72
Columns 73 through 81
Columns 82 through 90
Columns 91 through 99
14.9000 15.0000
>> yy=polyval(pxx,[xx]);
??? Undefined function or variable 'pxx'.
>> yy=polyval(pxx,[xx])
??? Undefined function or variable 'pxx'.
>> yy=polyval(pxx,[xx])
??? Undefined function or variable 'pxx'.
>> yy=polyval(pxx,[xx]);
??? Error using ==> polyval
Inputs to polyval must be floats, namely single or double.
>> yy=polyval(px,[xx]);
??? Error using ==> polyval
Inputs to polyval must be floats, namely single or double.
>> yy=polyval(Pxx,[xx]);
??? Undefined function or variable 'Pxx'.
>>
>> y=polyval(Pxx,[xx]);
??? Undefined function or variable 'Pxx'.
>> yk=polyval(Pxx,[xx]);
??? Undefined function or variable 'Pxx'.
>> p=[12 15 16 8]
p=
12
15
16
>> polu(p)
??? Undefined function or method 'polu' for input arguments of type
'double'.
>> poly(p)
ans =
-51
>> roots(p)
ans =
-0.2737 + 0.9348i
-0.2737 - 0.9348i
-0.7027
>> polyder(p)
ans =
36
30
16
956
-7776
23040
>> polyval(p,[roots(p)])
ans =
1.0e-013 *
0.0178 - 0.1021i
0.0178 + 0.1021i
0.0266
>> polyval(poliderp,[roots(p)])
??? Undefined function or variable 'poliderp'.
>> polyval(polider(p),[roots(p)])
??? Undefined function or method 'polider' for input arguments of type
'double'.
>> polyval(polider(p),roots(p))
??? Undefined function or method 'polider' for input arguments of type
'double'.
>> polyval(polyder(p),roots(p))
ans =
-20.9725 + 9.6253i
-20.9725 - 9.6253i
12.6950
x=
12
15
16
13
>> y=[8 9 7 6]
y=
>> y2=interp1(x,y,[linspace(5,15,100)],'cubic');
>> p=[12 15 16]
p=
12
15
16
>> q=[2 3 6]
q=
>> roots(p-q)
ans =
-0.6000 + 0.8000i
-0.6000 - 0.8000i
>> polyval(q,[roots(q)])
ans =
0
0
>> y2=interp1(x,y,[linspace(5,15,100)],'cubic')
y2 =
Columns 1 through 9
Columns 10 through 18
Columns 19 through 27
Columns 28 through 36
Columns 37 through 45
0.3102
1.7927
3.1413
9.2660
9.7291 10.1047
Columns 46 through 54
5.4576
10.3980
6.4355
7.3001
8.0566
8.7102
Columns 55 through 63
Columns 64 through 72
9.9354
7.4703
9.6630
9.3700
9.0617
8.7432
8.4197
8.0962
7.7781
6.4463
6.2679
6.1308
6.0401
6.0011
Columns 73 through 81
7.1781
6.0143
6.9066
6.6609
Columns 82 through 90
6.0699
7.4773
6.1630
6.2891
6.4434
6.6215
6.8185
7.0299
7.2510
8.3405
8.5227
8.6822
8.8143
8.9144
Columns 91 through 99
7.7040
8.9778
7.9265
8.1402
Column 100
9.0000
p=
12
15
16
>> polyint(p)
ans =
4.0000
7.5000 16.0000
>> poly2sym(p)
ans =
12*x^2 + 15*x + 16
>> ps=[1 0 0 8 0]
ps =
>> pu=[0 0 0 1 0]
pu =
>> roots(ps-pu)
ans =
0
-1.9129
0.9565 + 1.6566i
0.9565 - 1.6566i
q=
15
12
16
17
>> potyint(polyint(q))
??? Undefined function or method 'potyint' for input arguments of type
'double'.
>> a=polyint(q)
a=
3.7500
4.0000
8.0000 17.0000
>> q=polyint(a)
q=
0.7500
1.0000
q=
15
12
16
>> a=polyder(q)
17
2.6667
8.5000
a=
45
24
16
>> w=polyint(a)
w=
15
12
16
>> w=polyder(a)
w=
90
24
q=
15
12
16
p=
12
15
16
17
t=
1.0000
>>
2.0500
3.4000
3.5333
2.8389
1.5111