What does operator “dot” (.) mean?
Question:
Given the code :
A = [1 2 3; 3 2 1]
B = A.^2
The output :
B =
1 4 9
9 4 1
But if I do this : B = A^2
The output is :
Error using ^
Inputs must be a scalar and a square matrix.
To compute elementwise POWER, use POWER (.^) instead.
What does the operator . do exactly ?
Answer:
The dot itself is not an operator, .^ is.
The .^ is a pointwise¹ (i.e. element-wise) power, as .* is the
pointwise product.
.^Array power.A.^Bis the matrix with elements
A(i,j)to theB(i,j)power.AandBmust have the same size, unless one of them is a scalar.
C.f.
- "Matrix and array arithmetic": http://www.mathworks.de/help/techdoc/ref/arithmeticoperators.html
- "Pointwise": http://en.wikipedia.org/wiki/Pointwise
- "Element-Wise Operations": http://www.glue.umd.edu/afs/glue.umd.edu/system/info/olh/Numerical/Matlab_Matrix_Manipulation_Software/Matrix_Vector_Operations/elementwise
¹) Hence the dot.
What does operator “dot” (.) mean?的更多相关文章
- 特殊的ASCII码对应的字符
Special Characters " " " quotation mark u+0022 ISOnum p:before { content:"\0022& ...
- 【HTML】字符(Glyphs)收集
Special Characters " " " quotation mark u+0022 ISOnum p:before { content:"\0022& ...
- hdu 4773 Problem of Apollonius
莫名其妙就AC了-- 圆的反演-- 神马是反演? 快去恶补奥数-- #include<iostream> #include<map> #include<string> ...
- 图论(KM算法,脑洞题):HNOI 2014 画框(frame)
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAABPoAAANFCAIAAABtIwXVAAAgAElEQVR4nOydeVxTV/r/n9ertaJEC4
- WAJUEJI which home strong!
算法:搜索+优先队列 描述 在一个山沟里,姐弟俩同时考上了大学.但由于家里拮据,所以这并不是什么好消息.父亲对孩子说:我就是砸锅卖铁也要把你们姐俩供出来. 当时的姐姐已经决定放弃上学的机会. 没想到第 ...
- Ignatius and the Princess I
算法:搜索+优先队列+(递归输出结果) The Princess has been abducted by the BEelzebub feng5166, our hero Ignatius has ...
- c++ 17介绍
作者:hearts zh链接:https://www.zhihu.com/question/32222337/answer/55238928来源:知乎著作权归作者所有.商业转载请联系作者获得授权,非商 ...
- csu 1503: 点弧之间的距离-湖南省第十届大学生计算机程序设计大赛
这是--比量p并用交点连接中心不上弧.在于:它至p距离.是不是p与端点之间的最短距离 #include<iostream> #include<map> #include< ...
- 看到了必须要Mark啊,最全的编程中英文词汇对照汇总(里面有好几个版本的,每个版本从a到d的顺序排列)
java: 第一章: JDK(Java Development Kit) java开发工具包 JVM(Java Virtual Machine) java虚拟机 Javac 编译命令 java ...
随机推荐
- WSGI and Paste学习笔记
The Problem Lots of web frameworks Zope, Quixote, Webware, SkunkWeb and Twisted Web etc Applications ...
- 2018年1月20日上海MVP线下技术分享会纪实
1月20日正值大寒节气,在微软MVP朱兴亮的组织牵头下,上海MVP自发举办了题为<跟社区专家一起聊聊混合云.领域驱动.区块链和数字营销>的技术交流会.四名来自上海的MVP分别在自己擅长的技 ...
- ThreadLocal类的简单使用
1.概述变量值的共享可以使用public 是static 变量的形式,所有的线程都使用同一个public static 变量. 如实现线程内的共享变量,jdk提供了ThreadLocal来解决这个问题 ...
- UnicodeDecodeError:utf-8codeccantdecodebyte0xb9inposition0:invalidstartbyte
相信这个问题大家都会以为是编码的问题,当然原本我也以为是编码问题! 然后试了各种方案!都是以失败告终! 哈哈哈,后来解决了,原来真是闹了个大笑话............ 这是因 ...
- laravel migrate时报错:Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes
今天在学习laravel的路由模型绑定时,在按照文档执行php artisan migrate时报错. In Connection.php line 664: SQLSTATE[42000]: Syn ...
- 简单读!Mybatis源码(一)一条select的一生
工具除了会用,还应该多做点.我觉得使用一个软件工具(开源类),一般会经历几个步骤: 1. 通过wiki了解大致作用,然后开始码代码: 2. 系统性地学习其特性,找出可能需要的点,用上去: 3. 通过阅 ...
- Net Core平台灵活简单的日志记录框架NLog+SqlServer初体验
Net Core平台灵活简单的日志记录框架NLog+SqlServer初体验 前几天分享的"[Net Core平台灵活简单的日志记录框架NLog+Mysql组合初体验][http://www ...
- springBoot(2)---快速创建项目,初解jackson
快速创建项目,初解jackson 一.快速创建项目 springboot官网提供了工具类自动创建web应用:网址:http://start.spring.io/ 官网页面 1.快速创建一个 选择web ...
- java~springboot~h2数据库在单元测试中的使用
单元测试有几点要说的 事实上springboot框架是一个tdd框架,你在进行建立项目时它会同时建立一个单元测试项目,而我们的代码用例可以在这个项目里完成,对于单元测试大叔有以下几点需要说明一下: 单 ...
- leetcode — unique-paths
import java.util.Arrays; /** * Source : https://oj.leetcode.com/problems/unique-paths/ * * * A robot ...