Matlab求助:Inputs must be a scalar and a square matrixx=0:0.1:5;y=sqrt((442.1*cos(x+4)-12.4)^2+(442.1*sin(x+4)-174.9)^2);运行后就出现了上面的.

来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/18 15:39:54
Matlab求助:Inputsmustbeascalarandasquarematrixx=0:0.1:5;y=sqrt((442.1*cos(x+4)-12.4)^2+(442.1*sin(x+4)

Matlab求助:Inputs must be a scalar and a square matrixx=0:0.1:5;y=sqrt((442.1*cos(x+4)-12.4)^2+(442.1*sin(x+4)-174.9)^2);运行后就出现了上面的.
Matlab求助:Inputs must be a scalar and a square matrix
x=0:0.1:5;
y=sqrt((442.1*cos(x+4)-12.4)^2+(442.1*sin(x+4)-174.9)^2);
运行后就出现了上面的.

Matlab求助:Inputs must be a scalar and a square matrixx=0:0.1:5;y=sqrt((442.1*cos(x+4)-12.4)^2+(442.1*sin(x+4)-174.9)^2);运行后就出现了上面的.
把y的表达式改成下面就可以了
y=sqrt((442.1.*cos(x+4)-12.4).^2+(442.1.*sin(x+4)-174.9).^2);
错误出现的原因,矩阵元素的幂,不等于矩阵的幂,矩阵的幂是 ^ 而矩阵元素的幂就是 .^
请注意区别