Labfans是一个针对大学生、工程师和科研工作者的技术社区。 | 论坛首页 | 联系我们(Contact Us) |
![]() |
![]() |
#5 |
高级会员
注册日期: 2008-11-07
住址: 湖南长沙
帖子: 233
声望力: 21 ![]() |
![]()
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
__________________
坚持就是胜利,努力就有奇迹。 |
![]() |
![]() |