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 Amax(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 Amax(sum(abs(A)).
2 The largest singular value (same as norm(A)).
inf The infinity norm, or largest row sum of Amax(sum(abs(A'))).
'fro' The Frobenius-norm of matrix Asqrt(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 用法小记的更多相关文章

  1. matlab fscanf用法

    matlab fscanf用法 matlab中的fscanf的用法如下: A=fscanf(fid,format)[A, count]=fscanf(fid,format,size) [A, coun ...

  2. [转]HttpClient的超时用法小记

    HttpClient的超时用法小记 HttpClient在使用中有两个超时时间,是一直接触和使用的,由于上次工作中使用httpClient造成了系统悲剧的情况,特地对它的两个超时时间进行了小小的测试, ...

  3. linux expect, spawn用法小记

    linux expect, spawn用法小记_IT民工_百度空间 linux expect, spawn用法小记 版权声明:转载时请以超链接形式标明文章原始出处和作者信息及本声明http://sys ...

  4. [转载]expect spawn、linux expect 用法小记

    原文地址:expect spawn.linux expect 用法小记作者:悟世 使用expect实现自动登录的脚本,网上有很多,可是都没有一个明白的说明,初学者一般都是照抄.收藏.可是为什么要这么写 ...

  5. Shell常见用法小记

    shell的简单使用 最近发现shell脚本在平常工作中简直算一把瑞士军刀,很多场景下用shell脚本能实现常用的简单需求,而之前都没怎么学习过shell,就趁机把shell相关的语法和常见用法总结了 ...

  6. matlab norm的使用

    格式:n=norm(A,p)功能:norm函数可计算几种不同类型的矩阵范数,根据p的不同可得到不同的范数 以下是Matlab中help norm 的解释 NORM Matrix or vector n ...

  7. matlab norm 范式

    格式:n=norm(A,p) 功能:norm函数可计算几种不同类型的矩阵范数,根据p的不同可得到不同的范数 p  返回值  1  返回A中最大一列和,即max(sum(abs(A)))  2 返回A的 ...

  8. matlab fspecial 用法解释

    Matlab 的fspecial函数用法 fspecial函数用于建立预定义的滤波算子,其语法格式为:h = fspecial(type)h = fspecial(type,para)其中type指定 ...

  9. Linq用法小记

    一.什么是Linq? LINQ即Language Integrated Query(语言集成查询),LINQ是集成到C#和Visual Basic.NET这些语言中用于提供查询数据能力的一个新特性. ...

随机推荐

  1. socket编程原理

    socket编程原理 1.问题的引入 1) 普通的I/O操作过程: UNIX系统的I/O命令集,是从Maltics和早期系统中的命令演变出来的,其模式为打开一读/写一关闭(open-write-rea ...

  2. python中的lambda表达

    C++中的lambda表达式与C++11增加标准库,是一个简短的匿名的可调用对象,编译器会将其转化为一个匿名类的对象.lambda表达式的最大特点就是简短灵活.调用方便.它不须要处理非常复杂的逻辑.通 ...

  3. InstallShield12豪华版破解版下载|InstallShield下载|软件打包工具

    InstallShield 12 豪华版+破解版 下载 下载速度:220kb/s InstallShield 12为软件发行方提供率先的安装程序解决方式,可以制作强大可靠的Windows Instal ...

  4. NVMe 与 AHCI

    http://elf8848.iteye.com/blog/1731274 AHCI: NCQ技术,600MB/S,一个队列,每个队列32个指令 NVME:65000个队列,每个队列65000指令,3 ...

  5. 介绍 JSON

    出自官网:http://www.json.org/json-zh.html JSON(JavaScript Object Notation) 是一种轻量级的数据交换格式. 易于人阅读和编写.同时也易于 ...

  6. WPF组件开发

    在做组件之前,为了适应框架,我们需要有一个基类,并将这个基类打包成一个模板,让大部分组件去使用这个模板. 组件的基类就不多讲了,上篇文章中已经说过了.这是地址: http://www.cnblogs. ...

  7. Android 上使用 iconfont 的一种便捷方案

    最近在学习 AIOSO(Alibaba Internal Open Source Organization,即阿里巴巴内部开源组织) 的一个子项目MMCherryUI,这是一个流式布局,可以在运行时做 ...

  8. 【转】关于C#接口和抽象类的一些说明

    接口和抽象类 1.概念 什么是接口? 接口是包含一组虚方法的抽象类型,其中每一种方法都有其名称.参数和返回值. 接口方法不能包含任何实现,CLR允许接口可以包含事件.属性.索引器. 一个类可以实现多个 ...

  9. mysql免安装版使用

    打开命令行,到bin目录下,输入net start mysql 启动服务,输入mysql -u root -p回车后输入密码,进入mysql.

  10. angularJs ionic phoneGap 分享

    由于坑较多 就如“天下难事,必作于易吧” 最近有机会接触到了git  node angularJs ionic phoneGap 很开森也很痛苦 分享如下 推荐的几个博客地址: ionic开发插件之n ...