フィルターのクリア

Fast operations between matrix

2 ビュー (過去 30 日間)
Ran E
Ran E 2020 年 11 月 7 日
コメント済み: Ran E 2020 年 11 月 7 日
hello,
I have two matrix - the first one is 52X3 matrix and the second is 3X1 matrix
I want to know what is the fastest way to make a subtraction between the rows in seperately of the first matrix and the second matrix
for example: matrix numbe 1 - [1,2,3; 4,5,6; 6,7,8]
matrix number 2 - [0,1,2]
i want to substract the first row in matrix 1 with matrix 2, and then to substract the second row in matrix 1 with matrix 2 and so on.

回答 (1 件)

Bruno Luong
Bruno Luong 2020 年 11 月 7 日
A = rand(52,3)
B = rand(3,1)
S = A-B.'
  1 件のコメント
Ran E
Ran E 2020 年 11 月 7 日
thank you

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeCell Arrays についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by