Matlab norm 用法小记
2011-10-19 14:34
423 查看
norm(A,p)
当A是向量时
norm(A,p) Returnssum(abs(A).^p)^(1/p),forany1<=p<=∞.
norm(A) Returnsnorm(A,2)
norm(A,inf) Returnsmax(abs(A)).
norm(A,-inf) Returnsmin(abs(A)).
当A是矩阵时
n=norm(A)returnsthelargestsingularvalueofA,max(svd(A))
n=norm(A,1)The1-norm,orlargestcolumnsumofA,max(sum(abs(A)).
n=norm(A,2)Thelargestsingularvalue(sameasnorm(A)).
n=norm(A,inf)Theinfinitynorm,orlargestrowsumofA,max(sum(abs(A')))
n=norm(A,'fro')TheFrobenius-normofmatrixA,sqrt(sum(diag(A'*A))).
norm
Vectorandmatrixnorms
Syntax
n[code]=norm(A)
n=norm(A,p)
[/code]
Description
Thenormofamatrixisascalarthatgivessomemeasureofthemagnitudeoftheelementsofthematrix.The
normfunctioncalculatesseveraldifferenttypesofmatrixnorms:
n=norm(A)returnsthelargestsingularvalueof
A,
max(svd(A)).
n=norm(A,p)returnsadifferentkindofnorm,dependingonthevalueof
p.
Ifpis... | Thennormreturns... |
1 | The1-norm,orlargestcolumnsumofA, max(sum(abs(A)). |
2 | Thelargestsingularvalue(sameasnorm(A)). |
inf | Theinfinitynorm,orlargestrowsumofA, max(sum(abs(A'))). |
'fro' | TheFrobenius-normofmatrixA, sqrt(sum(diag(A'* A))). |
Aisavector:
norm(A,p) | Returnssum(abs(A).^p)^(1/p),forany1 <= p <= . |
norm(A) | Returnsnorm(A,2). |
Returnsmax(abs(A)). | |
Returnsmin(abs(A)). |
Notethat
norm(x)istheEuclideanlengthofavector
x.Ontheotherhand,MATLABuses"length"todenotethenumberofelements
ninavector.Thisexampleuses
norm(x)/sqrt(n)toobtainthe
root-mean-square(RMS)valueofan
n-elementvector
x.
x=[0123]
x=
0123
sqrt(0+1+4+9)%Euclideanlength
ans=
3.7417
norm(x)
ans=
3.7417
n=length(x)%Numberofelements
n=
4
rms=3.7417/2%rms=norm(x)/sqrt(n)
rms=
1.8708
相关文章推荐
- Matlab norm 用法小记
- matlab中fprintf函数的用法
- 用matlab的plot画图的几种用法
- matlab 读文件csvread textread用法实例
- MATLAB中plot的用法
- matlab中randi代替randint生成随机均匀分布信号的用法
- matlab switch case语句用法
- matlab中ezplot & solve函数的用法
- MATLAB中legend函数的用法
- matlab fscanf用法
- matlab plot函数说明和legend函数的基本用法(转)
- matlab冒号的用法总结
- 【转载】Matlab基本用法小结
- 【转】matlab标题,给figure加标题,subplot的部分用法
- 171103 Matlab subplot 用法
- matlab cell 函数用法
- Matlab的imfilter函数用法
- Matlab中fft函数的用法及关键问题详解
- matlab的mesh用法
- Matlab里evalin和assignin的用法