matlab中svd函数用法总结

1、帮助文档

svd

Singular value decomposition

Syntax

s = svd(X)
[U,S,V] = svd(X)
[U,S,V] = svd(X,0)
[U,S,V] = svd(X,'econ')

Description

The svd command computes the matrix singularvalue decomposition.

s = svd(X) returns a vectorof singular values.

[U,S,V] = svd(X) producesa diagonal matrix S of the same dimension as X,with nonnegative diagonal elements in decreasing order, and unitarymatrices U and V so that X= U*S*V'.

[U,S,V] = svd(X,0) producesthe "economy size" decomposition. If X ism-by-n with m > n, then svd computes onlythe first ncolumns of U and S isn-by-n.

[U,S,V] = svd(X,'econ') also produces the"economy size" decomposition. If X ism-by-n with m >= n, it is equivalent tosvd(X,0).For m < n, only the first m columns of V arecomputed and S is m-by-m.

Examples

For the matrix

X =
     1    2
     3    4
     5    6
     7    8

the statement

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

produces

U =
    -0.1525   -0.8226   -0.3945   -0.3800
    -0.3499   -0.4214    0.2428    0.8007
    -0.5474   -0.0201    0.6979   -0.4614
    -0.7448    0.3812   -0.5462    0.0407

S =
     14.2691         0
           0    0.6268
           0         0
           0         0

V =
    -0.6414     0.7672
    -0.7672    -0.6414

The economy size decomposition generated by

[U,S,V] = svd(X,0)

produces

U =
    -0.1525   -0.8226
    -0.3499   -0.4214
    -0.5474   -0.0201
    -0.7448    0.3812
S =
    14.2691         0
          0    0.6268
V =
    -0.6414    0.7672
    -0.7672   -0.6414

Diagnostics

If the limit of 75 QR step iterations is exhausted while seekinga singular value, this message appears:

Solution will not converge.
 
 

2、使用误区

>> S=svd(A)
??? Undefined function or method 'svd' for input arguments of type 'uint8'.
出错原因,A的数据类型为uint8
解决办法S=svd(double(A))


>> S=SVD(double(A))
??? Undefined function or method 'SVD' for input arguments of type 'double'.
出错原因,SVD在R2011a中不能被调用,区分大小写
解决办法S=svd(double(A))
  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值