主题: [MATLAB基础] matlab矩阵相乘的问题
查看单个帖子
旧 2009-04-30, 09:57   #5
laosam280
高级会员
 
注册日期: 2008-11-07
住址: 湖南长沙
帖子: 233
声望力: 21
laosam280 正向着好的方向发展
默认 回复: matlab矩阵相乘的问题

there is a more easier way to reach. you can change the dimensions of matrix A by using A,and than do a point time.
codes as follow are tested ok:
A=[1 2 3 4];
A1=[A;A]';
B=[1 2;2 3;3 4;4 5];
ans=A1.*B
>>
ans =

1 2
4 6
9 12
16 20
__________________
坚持就是胜利,努力就有奇迹。
laosam280 当前离线   回复时引用此帖