Matlab norm 用法小记
matlab norm (a) 用法以及实例
norm(A,p)
当A是向量时
norm(A,p) Returns sum(abs(A).^p)^(1/p), for any 1 <= p <= ∞.
norm(A) Returns norm(A,2)
norm(A,inf) Returns max(abs(A)).
norm(A,-inf) Returns min(abs(A)).
当A是矩阵时
n = norm(A) returns the largest singular value of A, max(svd(A))
n = norm(A,1) The 1-norm, or largest column sum of A, max(sum(abs(A)).
n = norm(A,2) The largest singular value (same as norm(A)).
n = norm(A,inf) The infinity norm, or largest row sum of A, max(sum(abs(A')))
n = norm(A,'fro') The Frobenius-norm of matrix A, sqrt(sum(diag(A'*A))).
norm
Vector and matrix norms
Syntax
n
=norm(A)
n=norm(A,p)
Description
The norm of a matrix is a scalar that gives some measure of the magnitude of the elements of the matrix. The norm function calculates several different types of matrix norms:
n = norm(A) returns the largest singular value of A, max(svd(A)).
n = norm(A,p) returns a different kind of norm, depending on the value of p.
If p is... |
Then norm returns... |
1 |
The 1-norm, or largest column sum of A, max(sum(abs(A)). |
2 |
The largest singular value (same as norm(A)). |
inf |
The infinity norm, or largest row sum of A, max(sum(abs(A'))). |
'fro' |
The Frobenius-norm of matrix A, sqrt(sum(diag(A'*A))). |
When A is a vector:
norm(A,p) |
Returns sum(abs(A).^p)^(1/p), for any 1 <= p <= . |
norm(A) |
Returns norm(A,2). |
norm(A,inf) |
Returns max(abs(A)). |
norm(A,-inf) |
Returns min(abs(A)). |
Remarks
Note that norm(x) is the Euclidean length of a vector x. On the other hand, MATLAB uses "length" to denote the number of elements n in a vector. This example uses norm(x)/sqrt(n) to obtain the root-mean-square (RMS) value of an n-element vector x.
x = [0 1 2 3]
x =
0 1 2 3 sqrt(0+1+4+9) % Euclidean length
ans =
3.7417 norm(x)
ans =
3.7417 n = length(x) % Number of elements
n =
4 rms = 3.7417/2 % rms = norm(x)/sqrt(n)
rms =
1.8708
Matlab norm 用法小记的更多相关文章
- matlab fscanf用法
matlab fscanf用法 matlab中的fscanf的用法如下: A=fscanf(fid,format)[A, count]=fscanf(fid,format,size) [A, coun ...
- [转]HttpClient的超时用法小记
HttpClient的超时用法小记 HttpClient在使用中有两个超时时间,是一直接触和使用的,由于上次工作中使用httpClient造成了系统悲剧的情况,特地对它的两个超时时间进行了小小的测试, ...
- linux expect, spawn用法小记
linux expect, spawn用法小记_IT民工_百度空间 linux expect, spawn用法小记 版权声明:转载时请以超链接形式标明文章原始出处和作者信息及本声明http://sys ...
- [转载]expect spawn、linux expect 用法小记
原文地址:expect spawn.linux expect 用法小记作者:悟世 使用expect实现自动登录的脚本,网上有很多,可是都没有一个明白的说明,初学者一般都是照抄.收藏.可是为什么要这么写 ...
- Shell常见用法小记
shell的简单使用 最近发现shell脚本在平常工作中简直算一把瑞士军刀,很多场景下用shell脚本能实现常用的简单需求,而之前都没怎么学习过shell,就趁机把shell相关的语法和常见用法总结了 ...
- matlab norm的使用
格式:n=norm(A,p)功能:norm函数可计算几种不同类型的矩阵范数,根据p的不同可得到不同的范数 以下是Matlab中help norm 的解释 NORM Matrix or vector n ...
- matlab norm 范式
格式:n=norm(A,p) 功能:norm函数可计算几种不同类型的矩阵范数,根据p的不同可得到不同的范数 p 返回值 1 返回A中最大一列和,即max(sum(abs(A))) 2 返回A的 ...
- matlab fspecial 用法解释
Matlab 的fspecial函数用法 fspecial函数用于建立预定义的滤波算子,其语法格式为:h = fspecial(type)h = fspecial(type,para)其中type指定 ...
- Linq用法小记
一.什么是Linq? LINQ即Language Integrated Query(语言集成查询),LINQ是集成到C#和Visual Basic.NET这些语言中用于提供查询数据能力的一个新特性. ...
随机推荐
- Solr配置与简单Demo[转]
Solr配置与简单Demo 简介: solr是基于Lucene Java搜索库的企业级全文搜索引擎,目前是apache的一个项目.它的官方网址在http://lucene.apache.org/sol ...
- android82 启动Actvity和Activity的生命周期
package com.itheima.jump; import android.net.Uri; import android.os.Bundle; import android.app.Activ ...
- LabVIEW系列——生产现场故障邮件通知
第一步.建立邮件服务器,winmail做邮件服务器是个不错的选择.不过在使用前需要注册. 第二步.创建修改域名.这里创建的域名不是真正的域名,只能用于局域网内.假设:lhy.com.cn 第三步.创建 ...
- NSURLConnection请求时间
在ios平台上做网络开发最常用的两个类: NSMutableURLRequest *urlRequest = [[NSMutableURLRequestalloc] initWithURL:url c ...
- hdu2041java
超级楼梯 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submis ...
- CI框架篇之视图篇--载入(1)
创建视图 创建视图文件很简单,只需要建立后缀名为‘.php’的文件, 然后保存文件到 application/views/ 文件夹即可 当然,随着工程的大小,你有必要对很多的视图根据控制器进行归类, ...
- CI框架篇之基础篇(2)
CodeIgniter 的基础了解了后,现在就来对这个框架进行预热 CodeIgniter 配置 理论是不用配置,直接拷贝到服务器目录下即可运行 CodeIgniter 安装分为四个步骤: 1. 解压 ...
- [XML] ResourceManager一个操作Resource的帮助类 (转载)
点击下载 ResourceManager.zip /// <summary> /// 类说明:Assistant /// 编 码 人:苏飞 /// 联系方式:361983679 /// 更 ...
- Android - 向服务器发送数据(POST) - HTTPClient.
该篇文章主要说明使用Apache提供的HTTPClient,通过post方式,向服务器发送数据.由于有些东西在 Android - 向服务器发送数据(GET)中提到过,就不再重复. 一,Android ...
- 关于HMTL -[HTML5]
前言: 为什么学习它?(HTML5) 会不会HTML5,其实并不会影响我的开发效率,我觉得终究还是跟个人性格有关,我喜欢前沿的东西.这就好比我大学里学的计算机,但我仍然会去看一些跟专业不相关的书籍一样 ...
.