matlab 矩阵运算的时候,出现“矩阵维度必须一致。”错误,求解释 5
x0=t(1);%x0,y0为平移参数y0=t(2);a=t(3);%a为旋转参数m=t(4);%m为尺度参数x1=[-141.2,-150.4,-49.2,34.8,5...
x0=t(1);% x0,y0为平移参数
y0=t(2);
a=t(3); % a为旋转参数
m=t(4); % m为尺度参数
x1 = [-141.2,-150.4,-49.2,34.8,55.6,250.5];
y1 = [83.4,-67.9,16.8,9.4,-64.2,22.4];
x = [1.3,1,3.2,5,5.5,9.7];
y = [4,1,2.8,2.5,1.2,2.8];
result = [x, y] - ([x1, y1].*[(1+m)*cos(a),(1+m)*sin(a);-(1+m)*sin(a),(1+m)*cos(a)]+[x0, y0]);
================
错误使用 .*
矩阵维度必须一致。
出错 xy (line 25)
result = [x, y] - ([x1',
y1']'.*[(1+m)*cos(a),(1+m)*sin(a);-(1+m)*sin(a),(1+m)*cos(a)]+[x0,
y0]); 展开
y0=t(2);
a=t(3); % a为旋转参数
m=t(4); % m为尺度参数
x1 = [-141.2,-150.4,-49.2,34.8,55.6,250.5];
y1 = [83.4,-67.9,16.8,9.4,-64.2,22.4];
x = [1.3,1,3.2,5,5.5,9.7];
y = [4,1,2.8,2.5,1.2,2.8];
result = [x, y] - ([x1, y1].*[(1+m)*cos(a),(1+m)*sin(a);-(1+m)*sin(a),(1+m)*cos(a)]+[x0, y0]);
================
错误使用 .*
矩阵维度必须一致。
出错 xy (line 25)
result = [x, y] - ([x1',
y1']'.*[(1+m)*cos(a),(1+m)*sin(a);-(1+m)*sin(a),(1+m)*cos(a)]+[x0,
y0]); 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询