⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 diary

📁 胡广书著的《现代信号处理教程》一书的例子的源码。都是Matlab程序。
💻
📖 第 1 页 / 共 4 页
字号:
    assumed to be real and nonsymmetric unless specified otherwise by OPTS.isreal
    and OPTS.issym. In all these EIGS syntaxes, EIGS(A,...) may be replaced by
    EIGS(AFUN,N,...).
 
    EIGS(AFUN,N,K,SIGMA,OPTS,P1,P2,...) and EIGS(AFUN,N,B,K,SIGMA,OPTS,P1,P2,...)
    provide for additional arguments which are passed to AFUN(X,P1,P2,...).
 
    Examples:
       A = delsq(numgrid('C',15));  d1 = eigs(A,5,'SM');
    Equivalently, if dnRk is the following one-line function:
       function y = dnRk(x,R,k)
       y = (delsq(numgrid(R,k))) \ x;
    then pass dnRk's additional arguments, 'C' and 15, to EIGS:
       n = size(A,1);  opts.issym = 1;  d2 = eigs(@dnRk,n,5,'SM',opts,'C',15);
 
    See also EIG, SVDS, ARPACKC.

eigs(b)

ans =

   34.0000
    8.9443
   -8.9443
    0.0000

h = hilb(8)

h =

    1.0000    0.5000    0.3333    0.2500    0.2000    0.1667    0.1429    0.1250
    0.5000    0.3333    0.2500    0.2000    0.1667    0.1429    0.1250    0.1111
    0.3333    0.2500    0.2000    0.1667    0.1429    0.1250    0.1111    0.1000
    0.2500    0.2000    0.1667    0.1429    0.1250    0.1111    0.1000    0.0909
    0.2000    0.1667    0.1429    0.1250    0.1111    0.1000    0.0909    0.0833
    0.1667    0.1429    0.1250    0.1111    0.1000    0.0909    0.0833    0.0769
    0.1429    0.1250    0.1111    0.1000    0.0909    0.0833    0.0769    0.0714
    0.1250    0.1111    0.1000    0.0909    0.0833    0.0769    0.0714    0.0667

cond (h)

ans =

  1.5258e+010

rcond(h)

ans =

  2.9522e-011

[V,D,S] = condeig(h)

V =

   -0.0000   -0.0005    0.0038    0.0207    0.0865    0.2775   -0.6295    0.7203
    0.0025    0.0188   -0.0858   -0.2661   -0.5501   -0.6449    0.1257    0.4325
   -0.0332   -0.1580    0.4188    0.6241    0.3363   -0.3352    0.2864    0.3188
    0.1799    0.4945   -0.5797   -0.0320    0.4592   -0.0513    0.3276    0.2552
   -0.4850   -0.5665   -0.1232   -0.4194    0.2756    0.1440    0.3321    0.2139
    0.6873   -0.0747    0.4185   -0.3655    0.0113    0.2729    0.3235    0.1845
   -0.4897    0.5688    0.3524   -0.0180   -0.2490    0.3570    0.3103    0.1625
    0.1383   -0.2829   -0.4083    0.4780   -0.4773    0.4116    0.2956    0.1453


D =

    0.0000         0         0         0         0         0         0         0
         0    0.0000         0         0         0         0         0         0
         0         0    0.0000         0         0         0         0         0
         0         0         0    0.0001         0         0         0         0
         0         0         0         0    0.0015         0         0         0
         0         0         0         0         0    0.0262         0         0
         0         0         0         0         0         0    0.2981         0
         0         0         0         0         0         0         0    1.6959


S =

    1.0000
    1.0000
    1.0000
    1.0000
    1.0000
    1.0000
    1.0000
    1.0000

rank(e)
??? Undefined function or variable 'e'.

rank(h)

ans =

     8

normbest(h)
??? Undefined function or variable 'normbest'.

normest(h)

ans =

    1.6959

trace(h)

ans =

    2.0218

orth(h)

ans =

   -0.7203    0.6295    0.2775   -0.0865    0.0207   -0.0038    0.0005    0.0000
   -0.4325   -0.1257   -0.6449    0.5501   -0.2661    0.0858   -0.0188   -0.0025
   -0.3188   -0.2864   -0.3352   -0.3363    0.6241   -0.4188    0.1580    0.0332
   -0.2552   -0.3276   -0.0513   -0.4592   -0.0320    0.5797   -0.4945   -0.1799
   -0.2139   -0.3321    0.1440   -0.2756   -0.4194    0.1232    0.5665    0.4850
   -0.1845   -0.3235    0.2729   -0.0113   -0.3655   -0.4185    0.0747   -0.6873
   -0.1625   -0.3103    0.3570    0.2490   -0.0180   -0.3524   -0.5688    0.4897
   -0.1453   -0.2956    0.4116    0.4773    0.4780    0.4083    0.2829   -0.1383

c = magic(4)

c =

    16     2     3    13
     5    11    10     8
     9     7     6    12
     4    14    15     1

inv(c)
Warning: Matrix is close to singular or badly scaled.
         Results may be inaccurate. RCOND = 1.306145e-017.

ans =

  1.0e+014 *

    0.9382    2.8147   -2.8147   -0.9382
    2.8147    8.4442   -8.4442   -2.8147
   -2.8147   -8.4442    8.4442    2.8147
   -0.9382   -2.8147    2.8147    0.9382

pinv(c)

ans =

    0.1011   -0.0739   -0.0614    0.0636
   -0.0364    0.0386    0.0261    0.0011
    0.0136   -0.0114   -0.0239    0.0511
   -0.0489    0.0761    0.0886   -0.0864

A = [3; 4]'

A =

     3     4

A = [3; 4]

A =

     3
     4

[U,S, V] = svd(A)

U =

   -0.6000   -0.8000
   -0.8000    0.6000


S =

     5
     0


V =

    -1

[l,s]=lu(A)

l =

    0.7500
    1.0000


s =

     4

A = magic(3)

A =

     8     1     6
     3     5     7
     4     9     2

[l,s]=lu(A)

l =

    1.0000         0         0
    0.3750    0.5441    1.0000
    0.5000    1.0000         0


s =

    8.0000    1.0000    6.0000
         0    8.5000   -1.0000
         0         0    5.2941

C = [1 1 1;2 -1 -1;2 -4 5]

C =

     1     1     1
     2    -1    -1
     2    -4     5

chol(C)
??? Error using ==> chol
Matrix must be positive definite.

qr(C)

ans =

   -3.0000    3.0000   -3.0000
    0.5000   -3.0000    3.0000
    0.5000   -1.0000   -3.0000

[q,r]=qr(C)

q =

   -0.3333   -0.6667   -0.6667
   -0.6667   -0.3333    0.6667
   -0.6667    0.6667   -0.3333


r =

    -3     3    -3
     0    -3     3
     0     0    -3

G = vander(4)

G =

     1

G = Toeplitz(4)

G =

     4

exit

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -