Matlab的一些报错及解决(不断补充)

01

 Error:At least one END is missing: the statement may begin here.

解决:结尾少了一个end,查看下自己的代码中是不是有条件或者循环执行语句少了end

 

02

情景:做矩阵除法A\B(左除A矩阵,即坐侧乘以A的逆矩阵)操作时报错 。求二元一次Ax=B中x的x1,x2分量。A=[a1,b1;a2,b2];B=[c1;c2];x=A\B;

Error: Undefined function 'inv' for input arguments of type 'uint8

Error using  \
Linear algebra is not supported for integer data types.

解决:将所有矩阵元素都变成双精度,double(a1),double(b1),double(c1)....就会可以了A\B以及inv只能针对双精度元素矩阵。

 

你可能感兴趣的:(matlab)