Matrix Division: Different sized matrices
35 ビュー (過去 30 日間)
古いコメントを表示
I have one matrix A = [745 678]. I have another matrix B = [745 1].
I want to compute A / B. I want the result to be a [745 678] matrix. So basically every row in A (from 1 to 678) will be divided by the column matrix B. The end result will be all the matrix elements of A divided by the matrix elements of B.
0 件のコメント
採用された回答
Walter Roberson
2019 年 6 月 7 日
In R2016b or later,
A ./ B
In earlier releases,
bsxfun(@rdivide, A, B)
5 件のコメント
Jan
2019 年 6 月 10 日
@Lane Dillon: repmat is most likely the least efficient method to solve the problem.
その他の回答 (1 件)
John D'Errico
2019 年 6 月 7 日
Is there a reason why you have not read the getting started tutorials? The manual is always a good thing to read.
C = A./B;
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Creating and Concatenating Matrices についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!