範數,是具有“長度”概念的函數。線上性代數、泛函分析及相關的數學領域,範數是一個函數,其為矢量空間内的所有矢量賦予非零的正長度或大小。半範數反而可以為非零的矢量賦予零長度。
1、向量範數
1-範數:
,即向量元素絕對值之和,matlab調用函數norm(x, 1) 。
2-範數:
,Euclid範數(歐幾裡得範數,常用計算向量長度),即向量元素絕對值的平方和再開方,matlab調用函數norm(x, 2)。
∞-範數:
,即所有向量元素絕對值中的最大值,matlab調用函數norm(x, inf)。
-∞-範數:
,即所有向量元素絕對值中的最小值,matlab調用函數norm(x, -inf)。
p-範數:
,即向量元素絕對值的p次方和的1/p次幂,matlab調用函數norm(x, p)。
2、矩陣範數
1-範數:
, 列和範數,即所有矩陣列向量絕對值之和的最大值,matlab調用函數norm(A, 1)。
2-範數:
,譜範數,即A'A矩陣的最大特征值的開平方。matlab調用函數norm(x, 2)。
-------------------- norm--------------------
matlab裡,doc norm的結果:
Description The norm function calculates several different
types of matrix and vector norms. If the input is a vector or a matrix:n = norm(X,2) returns the2-norm of X.
n = norm(X) is the same as n = norm(X,2).
n = norm(X,1) returns the 1-norm of X.
n = norm(X,Inf) returns the infinity norm of X.
n = norm(X,'fro') returns the Frobenius norm of X.
In addition, when the input is a vector v:n = norm(v,p) returns the p-norm of v.
The p-norm is sum(abs(v).^p)^(1/p).n = norm(v,Inf) returns the largest element of abs(v).
n = norm(v,-Inf) returns the smallest element of abs(v).
---------------------cross--------------------
matalb,doc cross:
Syntax
C = cross(A,B)
C = cross(A,B,dim)
Description
C = cross(A,B) returns the cross product of A and B.
•If A and B are vectors, then they must have a length of 3.
•If A and B are matrices or multidimensional arrays, then they must have the same size. In this case, the cross function treats A and B as collections of three-element vectors. The function calculates the cross product of corresponding vectors along the first array dimension whose size equals 3.
C = cross(A,B,dim) evaluates the cross product of arrays A and B along dimension, dim. A and B must have the same size, and both size(A,dim) and size(B,dim) must be 3. The dim input is a positive integer scalar.
C = cross(A,B)傳回向量叉積A和B,即,C = A x B,A和B必須是3元向量。
--------------- --makehgtform---------------
matlab,doc makehgtform:
Syntax
M = makehgtform
M = makehgtform('translate',[tx ty tz])
M = makehgtform('scale',s)
M = makehgtform('scale',[sx,sy,sz])
M = makehgtform('xrotate',t)
M = makehgtform('yrotate',t)
M = makehgtform('zrotate',t)
M = makehgtform('axisrotate',[ax,ay,az],t)
Description
Use makehgtform to create transform matrices for translation, scaling, and rotation of graphics objects. Apply the transform to graphics objects by assigning the transform to the Matrix property of a parent hgtransform object. See Examples for more information.
M = makehgtform returns an identity transform.
M = makehgtform('translate',[tx ty tz]) or M = makehgtform('translate',tx,ty,tz) returns a transform that translates along the x-axis by tx, along the y-axis by ty, and along the z-axis by tz.
M = makehgtform('scale',s) returns a transform that scales uniformly along the x-, y-, and z-axes.
M = makehgtform('scale',[sx,sy,sz]) returns a transform that scales along the x-axis by sx, along the y-axis by sy, and along the z-axis by sz.
M = makehgtform('xrotate',t) returns a transform that rotates around the x-axis by t radians.
M = makehgtform('yrotate',t) returns a transform that rotates around the y-axis by t radians.
M = makehgtform('zrotate',t) returns a transform that rotates around the z-axis by t radians.
M = makehgtform('axisrotate',[ax,ay,az],t) Rotate around axis [ax ay az] by t radians.
---------------------asin----------------------
matlab中asin是一個求反正弦的函數
注1:asin(x)中x的取值範圍為:-1<=x<=1
注2:asin計算出來的結果是以弧度制表示的。
使用方法如下:
a = sin(pi/6); % 計算結果為0.5
b = asin(a); % 計算結果為0.5236 = pi/6(弧度制表示)
最後,附個matlab綜合執行個體:
>> A=[1,2,2]
A =
1 2 2
>> norm_A=norm(A)//求得A的2範數
norm_A =
3
>> B=[2 1 2]
B =
2 1 2
>> CROSS_AB=cross(A,B) //求得AB面的法向量
CROSS_AB =
2 2 -3
>> M=makehgtform('xrotate',pi/2) //M為繞着X軸旋轉90度的旋轉矩陣
M =
1 0 0 0
0 0 -1 0
0 1 0 0
0 0 0 1
參考:
http://blog.csdn.net/left_la/article/details/9159949
http://www.cnblogs.com/sddai/p/5433346.html