Matlab运算之 norm,cross,makehgtform,asin(acos)
2017-03-27 22:20
676 查看
范数,是具有“长度”概念的函数。在线性代数、泛函分析及相关的数学领域,范数是一个函数,其为矢量空间内的所有矢量赋予非零的正长度或大小。半范数反而可以为非零的矢量赋予零长度。
,即向量元素绝对值之和,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)。
,
列和范数,即所有矩阵列向量绝对值之和的最大值,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---------------
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
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:
SyntaxM = 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
http://yishouce.com/matlab/func/makehgtform
相关文章推荐
- 图像处理 估计退化函数之运动模糊和矩阵matlab运算的一些实验情况
- MATLAB的算术运算和点运算
- 一分钟了解"matlab小数取整运算"
- **MATLAB** MATLAB的符号运算
- MATLAB符号运算--求导diff
- C++中cos,sin,asin,acos这些三角函数操作
- MATLAB矩阵的基本运算及操作
- matlab基本运算与函数
- matlab程序运算速度
- [资料文本] Matlab中图像的邻域与块运算(blkproc)
- matlab中各种范数求解norm
- matlab查找二值化图像边缘与二值图像形态学运算
- FPGA基础知识17(Matlab中滤波器的定点化 浮点运算转换为定点运算)
- 在matlab中,数组的指数运算有好几种定义方式
- 【mat】matlab矩阵运算及函数
- Matlab中矩阵运算
- matlab norm 范式
- k-折交叉验证(k-fold CrossValidation) matlab代码
- Matlab 2015b 并行运算 SPMD
- Matlab 图像处理 形态学 腐蚀 膨胀 开闭运算 连通分量