菜鸟,matlab程序出错,不知错在哪
来源:学生作业帮 编辑:搜搜考试网作业帮 分类:综合作业 时间:2024/07/04 06:06:16
菜鸟,matlab程序出错,不知错在哪
t1=0.25*pi:0.5*pi/100:0.75*pi;
t2=-5/6*pi:1/60*pi:5/6*pi;
x1=100*cos(t1);
y1=-100*sin(t1);
x2=(100+150*cos(t2))*cos(t1);
y2=-(100+150*cos(t2))*sin(t1);
Error using ==> mtimes
Inner matrix dimensions must agree.
t1=0.25*pi:0.5*pi/100:0.75*pi;
t2=-5/6*pi:1/60*pi:5/6*pi;
x1=100*cos(t1);
y1=-100*sin(t1);
x2=(100+150*cos(t2))*cos(t1);
y2=-(100+150*cos(t2))*sin(t1);
Error using ==> mtimes
Inner matrix dimensions must agree.
![菜鸟,matlab程序出错,不知错在哪](/uploads/image/z/8781409-1-9.jpg?t=%E8%8F%9C%E9%B8%9F%2Cmatlab%E7%A8%8B%E5%BA%8F%E5%87%BA%E9%94%99%2C%E4%B8%8D%E7%9F%A5%E9%94%99%E5%9C%A8%E5%93%AA)
x2=(100+150*cos(t2)).*cos(t1); % 矩阵对应元素相乘用 .*
y2=-(100+150*cos(t2)).*sin(t1); % 矩阵对应元素相乘用 .*
再问: 那t1和t2取值个数不同行不行?
再答: 不行
再问: 谢谢了
y2=-(100+150*cos(t2)).*sin(t1); % 矩阵对应元素相乘用 .*
再问: 那t1和t2取值个数不同行不行?
再答: 不行
再问: 谢谢了