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]

 채택된 답변

Alex Mcaulley
Alex Mcaulley 2019년 3월 14일

0 개 추천

A=[ 6 12 15];
B=[50 70 80 90;
20 50 40 30;
10 60 80 90];
C = B-repmat(A',1,4);

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Operators and Elementary Operations에 대해 자세히 알아보기

질문:

2019년 3월 14일

답변:

2019년 3월 14일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by