作业帮 > 综合 > 作业

matlab报错?Error using ==> mpower Inputs must be a scalar and

来源:学生作业帮 编辑:大师作文网作业帮 分类:综合作业 时间:2024/11/18 07:14:18
matlab报错?Error using ==> mpower Inputs must be a scalar and a square matrix.
t=0:pi/100:2*pi;
theta_1=2*pi*t;
b_c=sqrt(180^2+100^2-2*180*100*cos(2*pi-theta_1));
theta_4=acos((80-100*(180^2+b_c^2-100^2)/(360*b_c))/100);
soe=100*sin(atan(100*sin(theta_1)/(180+100*cos(theta_1))))+100*sin(theta_4);
plot(t,soe);
Error using ==> mpower
Inputs must be a scalar and a square matrix.
这个程序就一个自变量t
matlab报错?Error using ==> mpower Inputs must be a scalar and
theta_4=acos((80-100*(180^2+b_c^2-100^2)/(360*b_c))/100);
|
theta_4=acos((80-100*(180^2+b_c.^2-100^2)/(360*b_c))/100);
直接乘方是矩阵的乘方,只能用于标量和方阵
要求向量对应位置元素的平方要用.^
除法也要用./
soe=100*sin(atan(100*sin(theta_1)/(180+100*cos(theta_1))))+100*sin(theta_4);
|
soe=100*sin(atan(100*sin(theta_1)./(180+100*cos(theta_1))))+100*sin(theta_4);