作业帮 > 综合 > 作业

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

来源:学生作业帮 编辑:灵鹊做题网作业帮 分类:综合作业 时间:2024/04/29 07:38:14
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);