2D subtraction from 3D
9 ビュー (過去 30 日間)
古いコメントを表示
I have 3D matrix A=50x60x180 and I want subtract B=50x60 to get same size C=50x50x180? Can anybody use for loop to do this operation?
2 件のコメント
John Chilleri
2017 年 9 月 21 日
C = zeros(50,60,180);
for i = 1:180
C(:,:,i) = A(:,:,i) - B;
end
Is this what you mean?
採用された回答
Andrei Bobrov
2017 年 9 月 21 日
C = A - B;
or
C = bsxfun(@minus,A,B);
2 件のコメント
Walter Roberson
2017 年 9 月 21 日
The first of those works in R2016b or later but not in earlier versions.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Logical についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!