简体   繁体   English

如何将这个矩阵乘以 matlab

[英]How to multiply This matrix in matlab

so we have this matrix a=[1;2;3] and we want to multiply it by itself a*a ,所以我们有这个矩阵a=[1;2;3]并且我们想将它乘以a*a

However Matlab doesn't do this multiplicaiton, and suggests using a.^2 , but this only multiplies each member by itself ( 1;4;9 ) ...但是 Matlab 不执行此乘法运算,并建议使用a.^2 ,但这只会将每个成员乘以自身( 1;4;9 ) ...

so how to multiply in Matlab a*a (a^2) ??那么如何乘以 Matlab a*a (a^2) ??

Greeed格力

You can't multiply it by itself, because it's not square.你不能将它自相乘,因为它不是正方形。

You can multiply it by its transpose, though:不过,您可以将它乘以它的转置:

a * a'

or:要么:

a' * a

Which one you use depends on what you want.你使用哪一个取决于你想要什么。 But it sounds like you don't know what you want (otherwise there would be no question...)但听起来你不知道自己想要什么(否则就没有问题了......)

you can't multiply this two matrices, see why here:您不能将这两个矩阵相乘,请在此处查看原因:

在此处输入图像描述

In your case it is 3X1 matrix multiply by 3X1 matrix.在您的情况下,它是 3X1 矩阵乘以 3X1 矩阵。

http://en.wikipedia.org/wiki/Matrix_multiplication#Illustration http://en.wikipedia.org/wiki/Matrix_multiplication#Illustration

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM