documentt

Upload: rommel-andres-pozo

Post on 16-Mar-2016

213 views

Category:

Documents


0 download

DESCRIPTION

t

TRANSCRIPT

>> t=[0;0.2]

t =

0 0.2000

>> t=[0:0.2:2.4]

t =

Columns 1 through 9

0 0.2000 0.4000 0.6000 0.8000 1.0000 1.2000 1.4000 1.6000

Columns 10 through 13

1.8000 2.0000 2.2000 2.4000

>> y=[0;0.19;0.58;1.04;1.49;1.89;2.25;2.55;2.81;3.02;3.19;3.34;3.42;3.56;3.64;3.7;3.76;3.8;3.84]

y =

0 0.1900 0.5800 1.0400 1.4900 1.8900 2.2500 2.5500 2.8100 3.0200 3.1900 3.3400 3.4200 3.5600 3.6400 3.7000 3.7600 3.8000 3.8400

>> plot(t,y)??? Error using ==> plotVectors must be the same lengths. >> t=[0:0.2:3.6]

t =

Columns 1 through 9

0 0.2000 0.4000 0.6000 0.8000 1.0000 1.2000 1.4000 1.6000

Columns 10 through 18

1.8000 2.0000 2.2000 2.4000 2.6000 2.8000 3.0000 3.2000 3.4000

Column 19

3.6000

>> plot(t,y)>> plot(y,y)>> plot(y,t)>> plot(y,t)>> plot(t,y)>> plot(t,-y)>> a=log(y);>> plot(t,a)>> a=log(y-0.14);>> plot(t,a)Warning: Imaginary parts of complex X and/or Y arguments ignored >> a=ln(y);??? Undefined function or method 'ln' for input arguments of type 'double'. >> a=logn(y);??? Undefined function or method 'logn' for input arguments of type 'double'. >> a=log(y);>> a=log(y-4);>> a=log(y-4);>> plot(t,a)Warning: Imaginary parts of complex X and/or Y arguments ignored >> plot(a,t)Warning: Imaginary parts of complex X and/or Y arguments ignored >> plot(t,a)Warning: Imaginary parts of complex X and/or Y arguments ignored >> y=[0;0.19;0.58;1.04;1.49;1.89;2.25;2.55;2.81;3.02;3.19;3.34;3.46;3.56;3.64;3.7;3.76;3.8;3.84]

y =

0 0.1900 0.5800 1.0400 1.4900 1.8900 2.2500 2.5500 2.8100 3.0200 3.1900 3.3400 3.4600 3.5600 3.6400 3.7000 3.7600 3.8000 3.8400

>> a=log(y-4);>> plot(t,a)Warning: Imaginary parts of complex X and/or Y arguments ignored >> plot(t,a)Warning: Imaginary parts of complex X and/or Y arguments ignored >> xi=t(6:19,1)??? Index exceeds matrix dimensions. >> xi=t(7:19,1)??? Index exceeds matrix dimensions. >> xi=t(6:19,1)??? Index exceeds matrix dimensions. >> xi=t(6:18,1)??? Index exceeds matrix dimensions. >> xi=t(6:19,1)??? Index exceeds matrix dimensions. >> t=t'

t =

0 0.2000 0.4000 0.6000 0.8000 1.0000 1.2000 1.4000 1.6000 1.8000 2.0000 2.2000 2.4000 2.6000 2.8000 3.0000 3.2000 3.4000 3.6000

>> xi=t(6:19,1)

xi =

1.0000 1.2000 1.4000 1.6000 1.8000 2.0000 2.2000 2.4000 2.6000 2.8000 3.0000 3.2000 3.4000 3.6000

>> yi=20log(y);??? yi=20log(y); |Error: Unexpected MATLAB expression. >> yi=20*log(y);>> yii=yi(6:19,1)

yii =

12.7315 16.2186 18.7219 20.6637 22.1051 23.2004 24.1194 24.8254 25.3952 25.8397 26.1667 26.4884 26.7000 26.9094

>> help polyfit POLYFIT Fit polynomial to data. P = POLYFIT(X,Y,N) finds the coefficients of a polynomial P(X) of degree N that fits the data Y best in a least-squares sense. P is a row vector of length N+1 containing the polynomial coefficients in descending powers, P(1)*X^N + P(2)*X^(N-1) +...+ P(N)*X + P(N+1). [P,S] = POLYFIT(X,Y,N) returns the polynomial coefficients P and a structure S for use with POLYVAL to obtain error estimates for predictions. S contains fields for the triangular factor (R) from a QR decomposition of the Vandermonde matrix of X, the degrees of freedom (df), and the norm of the residuals (normr). If the data Y are random, an estimate of the covariance matrix of P is (Rinv*Rinv')*normr^2/df, where Rinv is the inverse of R. [P,S,MU] = POLYFIT(X,Y,N) finds the coefficients of a polynomial in XHAT = (X-MU(1))/MU(2) where MU(1) = MEAN(X) and MU(2) = STD(X). This centering and scaling transformation improves the numerical properties of both the polynomial and the fitting algorithm. Warning messages result if N is >= length(X), if X has repeated, or nearly repeated, points, or if X might need centering and scaling. Class support for inputs X,Y: float: double, single See also poly, polyval, roots, lscov.

Reference page in Help browser doc polyfit

>> [P,S] = POLYFIT(xi,yii,19)Warning: Could not find an exact (case-sensitive) match for 'POLYFIT'.C:\Program Files\MATLAB\R2009a\toolbox\matlab\polyfun\polyfit.m is a case-insensitivematch and will be used instead.You can improve the performance of your code by using exactname matches and we therefore recommend that you update yourusage accordingly. Alternatively, you can disable this warning usingwarning('off','MATLAB:dispatcher:InexactCaseMatch').This warning will become an error in future releases. Warning: Polynomial is not unique; degree >= number of data points. > In polyfit at 72

P =

Columns 1 through 9

-0.0033 0.0820 -0.8838 5.3945 -20.0893 44.9268 -50.7819 0 55.7822

Columns 10 through 18

0 -89.1691 0 118.2863 0 -99.6496 0 0 70.3385

Columns 19 through 20

0 -21.5018

S =

R: [14x20 double] df: 0 normr: 0.0069

>> [P,S] = POLYFIT(xi,yii,14)Warning: Polynomial is not unique; degree >= number of data points. > In polyfit at 72

P =

1.0e+003 *

Columns 1 through 9

0.0001 -0.0032 0.0348 -0.2217 0.9003 -2.3909 4.0212 -3.6160 0

Columns 10 through 15

3.7280 -3.3159 0 1.6183 -0.8721 0.1299

S =

R: [14x15 double] df: 0 normr: 0.0120

>>

------------------------------------------------------------------------------------

u=[1;-1;-1;1;-1;1]

u =

1 -1 -1 1 -1 1

>> y=[0;2.15;-1.94;-2.05;1.98;-2.1]

y =

0 2.1500 -1.9400 -2.0500 1.9800 -2.1000

>> k=[0;1;2;3;4;5]

k =

0 1 2 3 4 5>> te=(x'*x)exp-1;??? te=(x'*x)exp-1; |Error: Unexpected MATLAB expression. >> te=(x'*x)*exp-1;??? Undefined function or variable 'x'. >> y=[2.15;-1.94;-2.05;1.98;-2.1]

y =

2.1500 -1.9400 -2.0500 1.9800 -2.1000

>> x=[0 1;2.15 -1;-1.94 -1;-2.05 1;1.98 -1]

x =

0 1.0000 2.1500 -1.0000 -1.9400 -1.0000 -2.0500 1.0000 1.9800 -1.0000

>> te=(x'*x)*exp-1;??? Error using ==> expNot enough input arguments. >> te=(x'*x)exp-1;??? te=(x'*x)exp-1; |Error: Unexpected MATLAB expression. >> te=(x'*x)*exp(-1);>> t=te* x'y;??? t=te* x'y; |Error: Unexpected MATLAB expression. >> t=te* x'*y

t =

-67.0240 31.9182

>>te=(x'*x)^-1;>> t=te* x'*y

t =

0.0198 2.0608

po=[10000 0;0 10000]

po =

10000 0 0 10000

>> x1=[0 1]

x1 =

0 1

>> l1=po*x1'*(1+x1*po*x1')^-1

l1 =

0 0.9999

>> e1=2.15-(x1*[0;0])

e1 =

2.1500

>> teta=l1*e1

teta =

0 2.1498

i=[1 1;1 1]

i =

1 1 1 1

>> p1=(i-l1*x1)*po

p1 =

1.0e+004 *

1.0000 1.0000 1.0000 0.0001