how should i subtract two matrices
2 次查看(过去 30 天)
显示 更早的评论
i need to subtrabt the first row B with the first number A
A=[ 6 12 15]
B=[50 70 80 90
20 50 40 30 % please note that vector B is a result of a for loop
10 60 80 90]
answer [44 64 74 84
8 38 28 18
-5 45 65 75]
0 个评论
采纳的回答
Alex Mcaulley
2019-3-14
A=[ 6 12 15];
B=[50 70 80 90;
20 50 40 30;
10 60 80 90];
C = B-repmat(A',1,4);
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Multidimensional Arrays 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!