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. Coordinate System

    Coordinate System Introduction of Different Coordinate Systems Cartesian Coordinate System UI Coordi ...

  2. java与javax有什么区别?

    java 是java j2sdk 中的类库,也就是Java Development kit . 它提供也一些基础的东西,如io库.桌面程序的类库,如awt.集合库(如Collection.List.M ...

  3. ThreadLocal 笔记

    synchronized 同步的机制可以解决多线程并发问题,这种解决方案下,多个线程访问到的都是同一份变量的内容.为了防止在多线程访问的过程中,可能会出现的并发错误.不得不对多个线程的访问进行同步,这 ...

  4. 各种vpn协议介绍(重点介绍sslvpn的实现方式openvpn)

    vpn介绍:   VIrtual Private Network 虚拟专用网络哪些用户会用vpn?    公司的远程用户(出差.家里),公司的分支机构.idc机房.企业间.FQ常见vpn协议有哪些?  ...

  5. 移动设备日期选择插件(基于JQUERY)

    上周花了2个小时写的一个日期选择插件,比较适合移动端的设备.先看个效果图吧.如果刚好是你需要的就往下吧,不需要的也可以继续..... 其实网络上已经有的了类似的成熟插件,比如基于mobiscroll, ...

  6. 在 Mac OS X 中建立加密的 Zip 压缩 -- 让机密资料加上密码

    在 Mac OS X 中要压缩档案的話,基本上就用滑鼠点右鍵选「压缩...」就可以制作 Zip 格式的压缩档,很方便.但如果是机密的资料要透过 Email 等管道传送时,常常会需要建立加密的 Zip ...

  7. 推送消息实现icon角标的动态显示

    在你自己服务器上做计数,客户端做减法并反馈给你的服务器 ,然后你服务器将需要显示的数字发送给苹果推送服务器(就是消息中的badge)比如:1,你服务器上发送出去3个推送消息到A手机           ...

  8. [LeetCode OJ] Word Search 深度优先搜索DFS

    Given a 2D board and a word, find if the word exists in the grid. The word can be constructed from l ...

  9. 说说http请求

    为什么做web前端要了解http标准?因为浏览器要从服务端获取网页,网页也可能将信息再提交给服务器,这其中都有http的连接.web系统既然和http链接有瓜葛,你就必须去了解它.我将从一下几个方面讲 ...

  10. (一)跟我一起玩Linux网络服务:DNS服务——BIND(/etc/named.conf、/var/named)设置实现和解释

    2015年3月24更新 添加了要加的配置域名解析器(否则会找不到域名)     一.创建该实验的的模型   配置完gate虚拟机的两张网卡后,就启动gate的转发 [root@localhost ro ...