matlab 矩阵运算*的小细节

来源:互联网 发布:哔哩哔哩直播软件 编辑:程序博客网 时间:2024/04/28 18:13

* 法矩阵运行时要注意矩阵要是double型的  ,不然会出现

Error using  * 
MTIMES is not fully supported for integer classes. At least one input must be scalar.
To compute elementwise TIMES, use TIMES (.*) instead.

错误,

eg:

B =   51   51   51   52   52   52   52   52   53   54   53   53   55   55   54   54A =   -0.0329    0.2359    0.9259   -0.1290C =   -0.0101    0.9998    0.0105   -0.0001 A*B*C的话会有错误Error using  * MTIMES is not fully supported for integer classes. At least one input must be scalar.To compute elementwise TIMES, use TIMES (.*) instead.
解决方法

B=double(B);

0 0